why does this code gets an "EOFerror: EOF when reading a line" on line 14? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

why does this code gets an "EOFerror: EOF when reading a line" on line 14?

while True: print("options: ") print("enter add for addition") print("enter sub to subtract") print("enter multiply for multiplication") print("enter divide for division") print("enter exponential to elevate a number to other") print("enter root to take square root of a number") user_input = input(":") if user_input == "quit": break elif user_input == "add": num1=float(input("Enter a number:")) num2=float(input("Enter another number:")) result=str(num1 + num2) print("The anwser is " + result) elif user_input == "sub" : num1=float(input("Enter a number:")) num2=float(input("Enter another number:")) result=str(num1 - num2) print("The anwser is " + result) elif user_input == "multiply": num1 = float(input("Enter a number:")) num2 = float(input("Enter another number:")) result = str(num1 * num2) print("The anwser is " + result) elif user_input == "devide": num1 = float(input("Enter a number:")) num2 = float(input("Enter another number:")) result = str(num1/num2) print("The anwser is " + result) elif user_input == "exponential": num1 = float(input("Enter a number:")) num2 = float(input("Enter another number:")) result = str(num1 ** num2) print("The anwser is " + result) elif user_input == "root": num1 = float(input("Enter a number:")) num2 = float(1/2) result = str(num1 ** num2) print("The anwser is " + result)

20th Oct 2018, 3:32 PM
Gabriel Amorim
Gabriel Amorim - avatar
2 Answers
20th Oct 2018, 3:52 PM
Ulisses Cruz
Ulisses Cruz - avatar
+ 1
thanks that's really helpful
20th Oct 2018, 4:03 PM
Gabriel Amorim
Gabriel Amorim - avatar