[Tutor] Invalid syntax error in my program
Kalpesh Naik
kalpeshnaik42 at gmail.com
Fri Aug 19 10:36:37 EDT 2016
Sir/Mam
i am doing python language program of simple calculator but there was some errors in my program
Please solve it and also guide me
#SIMPLE CALCULATOR
#1-Addition
#2-Subtraction
#3-Division
#4-Multiplication
#5-Modules
while True:
n=int(input("Enter your choice:"))
a=int(input("Enter 1st value:"))
print("1st value is:",a)
b=int(input("Enter 2nd value:"))
print("2nd value is:",b)
if n==1:
c=a+b
print("Addition is : ",c)
elif n==2:
d=a-b
print("Subtraction is : ",d)
elif n==3:
x=a/b
print("Division is : ",x)
elif n==4:
y=a*b
print("Multiplication is : ",y)
elif n==5:
z=a%b
print("modules is : ",z)
else:
print("!!!Enter wrong choice!!!")
More information about the Tutor
mailing list