I’m getting the NZEC error for the simple input statement. As I’m new to the codechef and also python, please guide me.
T = int(input())
I’m getting this error:
Traceback (most recent call last):
File “./prog.py”, line 1, in
EOFError: EOF when reading a line
Thanks and Regards,
POP
In codechef you have to provide input then click run.
#hackraj I have just typed.
T = int(input())
for this also it says NZEC error, and if I try to keep try - except block, the try block is not running.
I tried to solve this problem - “XYSTR Problem - CodeChef”
my code is:
T = int(input())
for i in range(T):
s = input()
c_x = 0
c_y = 0
for i in range(len(s)):
if s[i] == ‘x’:
c_x += 1
elif s[i] == ‘y’:
c_y += 1
print(min(c_x,c_y))
I’m always getting,
NZEC
Traceback (most recent call last):
** File “./prog.py”, line 1, in **
EOFError: EOF when reading a line
In for loop in both the places you are using i
for i in range(T) and again for i in range(len(s))
so just change i to J :- for j in range(T)
you have to provide the input to codechef by clicking on custom input and copy paste all the inputs to the box provided