Control Structures Simple Calculator EOF Error
I'm new so following directions. The comments section is full of alternative options for building the calculator. This is great but I'm not ready for that yet. I continue to get an EOF error for line 13 or 18 or 23 or 28. I have copied and pasted the exact code from the lesson. This leads me to believe the code in the lesson is written incorrectly. The input for the first number doesn't give me an option to input the number. This is the error: Traceback (most recent call last): File "./Playground/file0.py", line 18, in <module> num1 = float(input("Enter a number: ")) EOFError: EOF when reading a line This is the code from the lesson: 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") 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 answer is " + result) elif user_input == "subtract": num1 = float(input("Enter a number: ")) num2 = float(input("Enter another number: ")) result = str(num1 - num2) print("The answer is " + result) elif user_input == "multiply": num1 = float(input("Enter a number: ")) num2 = float(input("Enter another number: ")) result = str(num1 * num2) print("The answer is " + result) elif user_input == "divide": num1 = float(input("Enter a number: ")) num2 = float(input("Enter another number: ")) result = str(num1 / num2) print("The answer is " + result) else: print("Unknown input")