eof error in python program

i’ve written a simple program to find number of common elements among two lists…i’m getting eof error in first line itself…help me find where the problem is

t=int(input())
while(t):
count=0
n=input()
l1=list(map(int,input(),split()))
l2=list(map(int,input().split()))
for x in l1:
if x in l2:
count=count+1
print(count)
t=t-1

It means that you are taking more input than required. Check the input format and your input method. Also, whats the question? We need that to rule out that test cases have any issue (though its rare)

you should change your list .

l1=list(map(int,input().split())

there is an error in l1 but that is not the issue with EOF .The issue is with codechef ide itself.so try to use sublime txt or vim or emac or vscode and upload it

I FOUND THE SOLUTION!!!
Switch to the NON-IDE mode and copy your code their and submit it.
MAKE YOUR CODE IS WORKING IN OTHER IDE (LIKE PYCHARM OR ANY IDE OTHER THAN OF CODECHEF) .I was also stuck here and finally found the solution after 2 hours.
HAPPY CODING!

2 Likes

Thank you so much. Was stuck with this issue for a long time.