Help me fix elf error in calculator! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Help me fix elf error in calculator!

if user_input == "-": num3 = float(input("Enter a number: ")) num4 = float(input("Enter another number: ")) result2 = str(num3 - num4) print("The result is: " + result2) ThIS CODE prOducES eOF ERROR. HELPP!

21st Apr 2020, 12:06 PM
Aqualine27
Aqualine27 - avatar
6 Answers
+ 3
Without having the complete code linked here, it is only a guess what and why it happens. It would be great if you could help us. Thanks!
21st Apr 2020, 2:35 PM
Lothar
Lothar - avatar
+ 1
the code playground says: Traceback (most recent call last): File "./Playground/file0.py", line 9, in <module> num1 = float(input("Enter a number: ")) EOFError: EOF when reading a line
21st Apr 2020, 12:11 PM
Aqualine27
Aqualine27 - avatar
+ 1
what are you enter in the input
21st Apr 2020, 12:20 PM
Abdelhadi Sabani
Abdelhadi Sabani - avatar
0
i entered: if user_input == "-": num3 = float(input("Enter a number: ")) num4 = float(input("Enter another number: ")) result2 = str(num3 - num4) print("The result is: " + result2) ThIS CODE prOducES eOF ERROR. HELPP!
21st Apr 2020, 1:25 PM
Aqualine27
Aqualine27 - avatar
0
Because sololearn doesn't allow interactive input, try it on an online compiler like online gdb or programmerswiz
22nd Apr 2020, 10:44 AM
Varun Vaswani
Varun Vaswani - avatar
0
oh... ok TYSM i fixed it :D
5th Jul 2020, 4:34 PM
Aqualine27
Aqualine27 - avatar