i=0
while (i==0):
n1=float(input("Enter the first number: \n"))
n2=float(input("Enter the second number: \n"))
a=str(input("Choose the operation: \n 1.) + \n 2.) - \n 3.) * \n 4.) / \n 5.) % \n"))
if(a==1):
print("The addition of the inputted numbers is ", sum(n1,n2),"\n")
elif(a==2):
print("The difference between the inputted numbers is ", diff(n1,n2),"\n")
elif(a==3):
print("The multiplication of the inputted numbers is ", product(n1,n2),"\n")
elif(a==4):
print("The division of the inputted numbers is ", div(n1,n2),"\n")
elif(a==5):
print("The modulus of the inputted numbers is ", modulus(n1,n2),"\n")
else:
print("Do you want to quit the calculator?")
b=int(input("Press 00 for 'Yes' and 11 for 'No'\n"))
if(b==00):
break
else:
print("Enter a valid option for the operation number.\nThe calculator is re-starting.")
continue
This is my python code. I have defined all the functions used here.
The output I am getting is:
When I inputted the correct operation number 3 at the place I have circled in the image, why is the output not giving me the final calculated answer? Why is it repeating the same loop again and again?
Please help me in this.