0

In python what is the error in my code

while True : print("enter 'add' to add two numbers") print("enter 'subtract' to subtract two numbers") print("enter 'quit' to end the program") user_input=input(": ") if: user_input=="quit": break elif: user_input=="add": num1 =float(input("enter a number:")) num2 =float(input("enter second number:")) result=str(num1+num2) print(result) elif: user_input=="subtract": num1 =float(input("enter a number:")) num2 =float(input("enter second number:")) result=str(num1-num2) print(result) else: print("unknown inpu

16th Apr 2018, 4:36 PM
Gourav Yadav
Gourav Yadav - avatar
1 Answer
0
There alot of issues review the elif and if statements,indent well and close all brackets
2nd Dec 2022, 5:58 AM
Chris Jonathan
Chris Jonathan - avatar