It seems like that you're using Python3. If you want to use Python2, change `input` to `raw_input`. In Python2, `input()` runs user input as code, and `raw_input()` returns the string. `input()` in Python3 is equivalent to `raw_input()` in Python2.
On a rather unrelated note, do not put anything in `input()`. Anything in it is printed out to stdout, and the judge would regard it as a wrong answer because excess text is received. On Monday, April 6, 2020 at 5:45:33 PM UTC-7, Bal wrote: > > Hi I am new to python, i am receiving RE Error on my code. I Ran in system > everything works correct. > May i know what is the problem in my code. I used Python2 to run my code. > > def calculatetruce(table): > truce=0 > for i in range(len(table)): > truce+=table[i][i] > return truce > > def rowoccurence(table): > count=0 > for i in range(len(table)): > if(len(set(list(table[i])))<len(table)): > count+=1 > return count > > def coloccerence(table): > count=0 > for i in range(len(table)): > lst=[] > for j in range(len(table)): > lst.append(table[j][i]) > if(len(set(lst))<len(table)): > count+=1 > return count > > T=int(input("Enter Number of Test cases between 1 and 100:")) > for x in range(0,T): > out=[] > N=int(input("Enter Matrix size:")) > matrix=[] > for i in range(N): > a = list(map(int,input("\nEnter the numbers : > ").strip().split()))[:N] > matrix.append(a) > k=calculatetruce(matrix) > r=rowoccurence(matrix) > c=coloccerence(matrix) > out.append([k,r,c]) > for t in range(0,len(out)): > print('case #{}: {} {} > {}'.format(t+1,out[t][0],out[t][1],out[t][2])) > -- You received this message because you are subscribed to the Google Groups "Google Code Jam" group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/google-code/84429d77-7d46-4a83-ba3a-a9f2e38360b4%40googlegroups.com.