I was asked to put input so I print(5+5) and it was given me me the ryt up in my calculator. Print("enter 'add' two numbers") | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I was asked to put input so I print(5+5) and it was given me me the ryt up in my calculator. Print("enter 'add' two numbers")

while True: print("options:") print("enter 'add' to add two numbers") print("enter 'subtract' to subtract two numbers") print("enter 'multiply' to multiply two numbers") print("enter 'divide' to divide two numbers") print("enter 'quit' to end the program") if user_input == "quit": break elif user_input == "add": num1 = float(input("enter a number:")) num2 = float(input("enter a number:")) result = str(num1 + num2) print("the answer is" + result) elif user_input == "subtract": num1 = float(input("enter a number:")) num2 = float(input("enter a number:")) result = str(num1 + num2) print("the answer is" + result) elif user_input == "multiply": num1 = float(input("enter a number:")) num2 = float(input("enter a number:")) result = str(num1 + num2) print("the answer is" + result) elif user_input == "divide": num1 = float(input("enter a number:")) num2

21st Apr 2020, 5:17 PM
Fubara Gospel
2 Answers
+ 1
Where is your input command!!!!! From where you are getting input . I don't know ?
21st Apr 2020, 5:27 PM
Ayush Kumar
Ayush Kumar - avatar
0
Where they say use multiple input into separate lines
21st Apr 2020, 5:30 PM
Fubara Gospel