Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
0

# EOFError: EOF when reading a line/calculator/python

Hey. help me please I do calculator. emboss error EOFError: EOF when reading a line here's the code: while True: print("Options:") print("Enter '+' to add two numbers") print("Enter '-' to substract two numbers") print("Enter '*' to multiply two numbers") print("Enter '/' to divide two numbers") print("Enter 'Q' to end the program") user_input = input("please enter your input:") if user_input == "Q": break elif user_input == "+": num1 = float(input("Enter a number: ")) num2 = float(input("Enter another number: ")) result = str(num1 + num2) elif user_input == "-": num1 = float(input("Enter a number: ")) num2 = float(input("Enter another number: ")) result = str(num1 - num2) elif user_input == "*": num1 = float(input("Enter a number: ")) num2 = float(input("Enter another number: ")) result = str(num1 * num2) elif user_input == "/": num1 = float(input("Enter a number: ")) num2 = float(input("Enter another number: ")) print("The answer is " + result) else: print("Unknown input") I'm not so I do?

6th Jan 2017, 7:50 PM
Вадюха Марунич
2 Antworten
+ 1
@Ruslan Ovcharenko: We can give multiple inputs by giving one input each in a new line. Perhaps that solves the OP's issue as well.
8th Feb 2017, 5:52 PM
PythonProMaybe
0
sololearn doesn't support more than one input...
8th Feb 2017, 5:30 PM
Ruslan Ovcharenko
Heute heiß
c++ help