EOFError | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

EOFError

I am getting following error how to fix it please tell. print("Calculator") print("Options") print("Enter 'Add' for addition") print("Enter 'Minus' for subtracting") print("Enter 'multiply'for multiply") print("Enter 'division' for diving") print("Enter 'quit'for ENDING program") n = float(input("Enter first number")) no = float(input("Enter second number")) while True: a = input() if a == "add": add = str(n + no) print ("Your reault is "+ add) elif a == "Minus": sub = str(n - no) print ("Your result is "+ sub) elif a == "multiply": product = str(n * no) print ("Your result is "+ product) elif a == "division": quote = str(n/no) print ("Your result is "+ quote) elif a == "quite": break else: print("Invalid Input")

13th Dec 2018, 2:55 PM
Nitin Tiwari
Nitin Tiwari - avatar
3 Answers
+ 2
your code is 100% correct.....for some reason it's not running on sololearn code playground. But i checked...it's running on other editors
13th Dec 2018, 3:22 PM
Rishi Anand
Rishi Anand - avatar
+ 6
Nitin Tiwari, in sololearn only web codes run locally in your device. Rest all other codes with input are sent to sololearn's server where it executes the code and sends the result back on our device. Due to this limitation - We can't run time taking codes, or else we ll get "Time Limit Exceeded" error. - we cannot provide input after input (like in your code), we can only send all our inputs once. https://code.sololearn.com/cKqkg761OTKQ/?ref=app
13th Dec 2018, 7:20 PM
Morpheus
Morpheus - avatar
+ 1
Thank you sir
13th Dec 2018, 3:33 PM
Nitin Tiwari
Nitin Tiwari - avatar