Python input error

When i try to run a code in python on codechef it gives EOF error.

But the same thing if run with custom input it runs perfectly.

Have a look on the following link:

varun1097, did you ever find a solution to this?

did you ever find a solution to this?

Python Error Type like an error happened in a runtime error, called an exception. There built-in exceptions are defined in the Python library. Index Error is thrown
when trying to access an item at an invalid index.Other name of Error is means that Python tried to use a variable or function name, such as hello based on a previous definition. For more contact to CETPA.

Refer to :

Answer to this is using try and except… Let me show you how…

Suppose your code is :

t=int(input())
while t:
#Input code here
t-=1

and it shows EOF do one thing as shown below:

try:
t=int(input())
while t:
#Input code here
t-=1
except:
pass