I'm trying to make a simple GST(Australian) calculator and I keep getting this error, does anyone know what i have to do to fix | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I'm trying to make a simple GST(Australian) calculator and I keep getting this error, does anyone know what i have to do to fix

This is the code: type_of_calculation = int(input()) if type_of_calculation == 1: Price = float(input()) Tax = Price * 0.1 Final_price = Price + Tax print("Price", Price) print("Tax", Tax) print("Final_price", Final_price) elif type_of_calculation == 2: Final_price = float(input()) Price = Final_price / 1.1 Tax = Price / 11 print("Final_price", Final_price) print("Price", Price) print("Tax", Tax) and this is the error: Traceback (most recent call last): File "./Playground/file0.py", line 15, in <module> Final_price = float(input()) EOFError: EOF when reading a line

19th Jul 2023, 8:14 AM
Lucas Michaelides
Lucas Michaelides - avatar
2 Answers
+ 3
Take all inputs together with new line like 1 10.5
19th Jul 2023, 9:32 AM
A͢J
A͢J - avatar
+ 2
As A͢J said, the error isn't so much your program but an issue of how Sololearn handles input. If you run your program on a python compiler, it should work fine.
19th Jul 2023, 11:12 AM
Ausgrindtube
Ausgrindtube - avatar