I am new at python...I write this code. This is a uri problem and problem no 1478.Here the uri problem link:https://www.urionlinejudge.com.br/ju...lems/view/1478
My code:
but when i submit this on uri...showing something error.and couldnt found this.Please anyone help me to fine the error of my code.
My code:
Code:
while(1):
N=int(input())
if(N==0):
break
mainlist=[]
for i in range(0,N):
sublist=[]
for j in range(0,N):
sublist.append(9)
mainlist.append(sublist)
print(mainlist)
a=0
b=N
c=0
d=N-1
k=1
for j in range(0,N):
for i in range(a,b):
mainlist[c][i]=i+k
mainlist[i][c]=i+k
mainlist[d][N-1-i]=i+k
mainlist[N-1-i][d]=i+k
a+=1
b-=1
c+=1
d-=1
k-=1
for i in range(0,N):
for j in range(0,N-1):
print(" ",mainlist[i][j],end=" ")
print(" ",mainlist[i][N-1])
print("")
Comment