Python, Error while taking input

Thanks you explained really well :+1:

I provided custom input and the code worked. But now, while submitting it is causing Re(NZEC) Error.

3 Likes

bro, my code is working well and good with custom inputs but as i submit it shows either wrong answer, when i put it in the try/catch block or that runtime error (EOF error).

bro, my code is working well and good with custom inputs but as i submit it shows either wrong answer, when i put it in the try/catch block or that runtime error (EOF error).
why so?

Codechef doesn’t provide custom input in ide ,Thats why you get NZEC,

I think what you are doing is writing a code where you are supposed to give the compiler some input but ain’t supplying one.

If your code needs input, you need to give that to it by using the custom input. Or in case of submitting, codechef give its own test cases as input. I think this might be the issue here.

Using the RUN command without custom input will just give you NZEC. You may browse internet for the possible reasons why NZEC occurs for a program.
Here’s a link : https://www.geeksforgeeks.org/nzec-error-python/

Correct me if i am wrong.

Custom inputs are working fine but on submission it shows runtime error

1 Like

Then your code is broken. A RTE does not always mean a EOF error

Code is working fine on all custom inputs

It is working fine because you are acting as the grader and you are not as unfriendly to the code as the grader will be.

: ) . Thanks, it worked for me by switching to Non_IDE mode. I don’t know what’s wrong with the IDE mode

That really shouldn’t happen if you are submitting code.

Thanks it works for me :grinning:

Unlike other sites, simply running your code doesn’t take testcases as input. You need to check custom input xheck-box nd then put correctly formatted test data there before running

You should try to input the testcases in for loop.
Like this- for i in range(int(input()):

there’s nothing wrong with IDE mode, just that you need to specify custom input before running, else it gives you NZEC(EOFError)

yeh worked

same for me

I got the same error. Try this method :grin:

try:
{indentation}{your complete program here}
except:
{indentation}pass

Thanks dude … I was having the same problem .It sucks man