This repository was archived by the owner on May 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathanand.py
More file actions
executable file
·66 lines (51 loc) · 1.34 KB
/
anand.py
File metadata and controls
executable file
·66 lines (51 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
intent=input()
if intent=='for_loop':
to_send = """for x in range (a,b):
<code>"""
elif intent=='nested_for':
to_send = """for x in range(a,b):
for y in range(a,b):
<code>"""
elif intent=='if_condition':
to_send = """"if a==b:
<code>"""
elif intent=='nested_if':
to_send = """if a==b:
if a==b:
<code>"""
elif intent=='else_if':
to_send = """"elif a==b:
<code>"""
elif intent=='else_condition':
to_send = """"else:
<code>"""
elif intent=='while_loop':
to_send = """while x == y:
<code>"""
elif intent=='print':
to_send = """print('Enter your string here !') """
elif intent=='init_string' or intent=='init_char':
to_send="""var=input()"""
elif intent=='init_int':
to_send="""var=int(input())"""
elif intent=='init_double':
to_send="""var=double(input())"""
elif intent=='arith_addition':
to_send="""def add(a,b):
return a+b
ans=add(var1,var2)"""
elif intent=='arith_subtraction':
to_send="""def sub(a,b):
return a-b
ans=sub(var1,var2)"""
elif intent=='arith_multiplication':
to_send="""def mult(a,b):
return a*b
ans=mult(var1,var2)"""
elif intent=='arith_division':
to_send="""def divi(a,b):
return a/b
ans=divi(var1,var2)"""
else:
to_send ='hey'
print(to_send)