I am writing this function that checks if a list of lists is a real sudoku puzzle. When I check lists for real integers, I get unexpected results.
For instance:
lst = [[1,2,3],[2,3,1],[4,2,1]]
for i in lst:
for v in i:
print type(v)
<type 'int'>
for i in lst:
for v in i:
if v is int:
print True
Doesn’t print anything, and when I through:
for i in lst:
for v in i:
if v is not int:
print False
Prints everything False? Not sure what is going on, especially with the type showing that they are whole.
source
share