EOF Error python 3 (Not in CUSTOM INPUT)

Screenshot%20(8)|690x388

Can anyone explain why such error is occuring each time when running the code. ???
but it is seemed that the code is successfully executed when the same input values in the question is given as custom input …
i’m getting stuck in every questions while providing input values… :-/

###############################################################
this is where the error is not found… SUCCESSFULLY EXECUTED

#########C O D E ############
T=int(input())
while T>0:
n=int(input())
li=[i for i in range(1,n+1)]
for m in range(1,n):
li[0]=li[0]+li[1]+(li[0]*li[1])
li.remove(li[1])
print(li[0])
T=T-1

###CODE: REDONE

Read this to understand this error and cause.

i’m also getting the same error in python…i’m new to codechef
plz help me to solve this