Please ignore secret bonuses. Secret tests do NOT award bonus. Max hw grade is 30+2 bonus efficiency

Do you need help?

Notice Board

Per partecipare al corso di Fondamenti di programmazione 2023-24 loggatevi e attivatelo nella vostra pagina dei corsi preferiti. A quel punto il corso appare nel menù personale cliccando sul proprio avatar. Per i materiali degli anni precedenti seguite lo stesso metodo.

To join the Programming/Lab 2023-24 course, log-on and select it on the my courses page. It will appear on the personal menu of your avatar. For earlier years use the same method.

About EOF Error

a
aryansaini (240 points)
1 2 3
in News by (240 points)

What does this following error mean?

Traceback (most recent call last):
  File "/home/runner/List-with-input-odd-numbers-aryansaini22/main.py", line 18, in <module>
    print(list_with_odd_input())
  File "/home/runner/List-with-input-odd-numbers-aryansaini22/main.py", line 9, in list_with_odd_input
    n = int(input("enter number: "))
EOFError: EOF when reading a line
148 views

3 Answers

Gianmariaromano (5820 points)
0 0 13
by (5.8k points)
You can't use "input" and "print" functions, so you must use different strategies.
a
aryansaini (240 points)
1 2 3
by (240 points)
Oh okay, but the ques itself says take input from user and meanwhile other two tests are passing.
E
Egnald Çela (2320 points)
7 12 29
by (2.3k points)
Input from user is probably the function’s inputs given by the test files ( i believe ). what exercise is this?
Cicchinellit (2700 points)
9 17 33
by (2.7k points)
you shouldn't have input() and print() in your functions when testing in the prompt
Grace (3270 points)
0 0 4
by (3.3k points)
If it's not the homework, but the replit exercise ""def list_with_odd_input():" as written in the error message, you can use "input" and "print". In fact, I use them and my exercise passes all the tests. The EOF error, though, occurs when you ask the user for input, but you do not provide any input. I cannot see your source code, so I am not able to help you any further...