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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-code/cfd2c776-72e8-4d0a-8dca-4b5020152f3f%40googlegroups.com.