EOF python error Even when custom input is given

My code works fine on IDE but shows
Traceback (most recent call last):
File “./prog.py”, line 1, in
EOFError: EOF when reading a line
in codechef
I have read about this in previous forums mentioning that custom input solves the problems sadly it didnt work either
I have given custom input and run it It ran fine and gave output but the moment i submit it shows same error.
HELP . (>_<)

EOF error shows up when you try to input a variable which does not exist…
Try reading question carefully…might help

use try except block in python

ex:

try:
  n = input()
except:
  break