Why there is a strange numbers in my 5 queens checker?

i written a simple code to check your answer in 5 queens, i finished with horizontal positions but i have a problem in diagonal positions . when the code is executed i observe in some cases a strange numbers that was supposed to be not displayed, this an example (the strange nubers is with yellow. thanks for help.

l5=[] def Check(): for r in range(5):     for c in range(5):         if r*5+c in l:             while 0<=r<=4 and 0<=c<=4 :                  print(r,c)                 x=r*5+c                 l5.append(x)                 r+=1                 c+=1    print("l5:",l5) 

enter image description here