Why do I get a trace error? Help pls (solved) | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

Why do I get a trace error? Help pls (solved)

Iā€™m trying to do one of the practice exercises which is calculate an average grade and output a value. Anyway, when I run this on my laptop it works fine, but when I do it on my phone it gives a traceback error on line 3. Does anybody see whatā€™s the problem? Could you help me pls? Thanks name = input() sem1_score = int(input()) sem2_score = int(input()) avescore = (sem1_score + sem2_score) / 2 if avescore >= 90 and avescore <= 100: print(50) elif avescore >= 80 and avescore <= 89: print(30) elif avescore >= 70 and avescore <=79: print(10) else: print(0)

17th Oct 2020, 11:42 AM
Irianni MuƱoz
Irianni MuƱoz - avatar
4 Respostas
+ 6
probably because sololearn doesnt take interactive input. Here, you need to enter all inputs at the start of the program. whats your input and expected output? And exactly what error did you get?
17th Oct 2020, 11:47 AM
Slick
Slick - avatar
+ 1
the error says: Traceback (most recent call): ā€œFile/usercode/file0.pyā€ line 3, in <module> sem2_score = int(input()) EOFError: EOF when reading a line expected input is 67 and 84 and expected output is 10. Thanks
17th Oct 2020, 11:58 AM
Irianni MuƱoz
Irianni MuƱoz - avatar
+ 1
Thank you! And yup, that EOF error gets thrown in this exact situation where it was expecting input and didnt get it. You can still run your programs here, when it asks for input, instead of typing: 67 (then hitting submit) type: 67 ( then, in the same input box hit enter to go to the next line. This is how multiple inputs are gathered) 84 * THEN hit submit
17th Oct 2020, 12:06 PM
Slick
Slick - avatar
+ 1
Thank you! Itā€™s running perfectly now
17th Oct 2020, 12:22 PM
Irianni MuƱoz
Irianni MuƱoz - avatar