Python 3 code always results in Runtime error: NZEC

I cannot get any python program to run
as soon as I do an input(), I end up with a NZEC. For example this 1 line program fails:
input()

Error is
Traceback (most recent call last):
File “./prog.py”, line 1, in
EOFError: EOF when reading a line

Can you please help me with this?

Just provide some input to the program

I’ve tried multiple problems they always result in NZEC
I’m using a template that is accepted by atcoder, codeforces and all, I’ve even simplified it as much as I could: as soon as I call input() I got a problem

There is somehow a problem with the python3 code runner: I’ve searched for some accepted python3 solution and submitted them, I’m again getting a NZEC

The only way for me to not get a non-zero return code is to not call input() which makes it very hard to solve a problem :wink:

Thanks for your help

Your code is most likely correct, but you are Running without Providing “Custom Input”.

1 Like

Thank you @everule1that allows me to run the custom testcase: great

Nevertheless, when submitting I’m getting the runtime error again: is there a way to inspect the stacktrace or something about my submission?

Thanks again

1 Like

Are you trying to run the code in CodeChef’s IDE?
If so, select custom input and provide the input.

Else, please provide the code.

I managed to run the code with custom input (seems like a common mistake), but without touching the code, I just click on submit with the same code and get the NZEC

Are you trying to run the code on CodeChef IDE? Or are you submitting to a problem?

You are submitting your submission for COVIDLQ, on COVID by mistake.

even i am facing same problem. solution:->put input part in try block
and in except block write random expression a=5 etc 100%works

what do you mean? sarthak_JaIn29

CodeChef: Practical coding for everyone can someone tell me why i am getting nzec error in this code…

T=int(input())
1<= T and T <=1000
for S in range(T):
A=int(input())
B=int(input())
C=int(input())
S =(A+B+C)
if S==180:
print(“Yes”)
else :
print(“No”)

Plz any body help me on this it show runtime error in codechef refer to question link given below

#try this
try:
# code that you want to execute example
T=int(input())
1<= T and T <=1000
for S in range(T):
A=int(input())
B=int(input())
C=int(input())
S =(A+B+C)
if S==180:
print(“Yes”)
else :
print(“No”)
except:
pass
#note:use try: ,except:,pass in your code as mentioned above

You should print “YES” and “NO” not “Yes” and “No”

To avoid NZEC write your program like

try:
// your code

except:
pass

now you will never get error of NZEC

3 Likes