so I've been having trouble checking if the number 0 is in a group of lists within another list. These rows make up the maze for a pacman type game I'm making so the point of this is to check if pacman has eaten all of the coins.
Here's my code:
row1 =[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3]
row2 =[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
row3 =[1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1]
row4 =[1,0,1,1,0,1,1,1,0,1,0,1,1,1,0,1,1,0,1]
row5 =[1,0,1,1,0,1,1,1,0,1,0,1,1,1,0,1,1,0,1]
row6 =[1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1]
row7 =[1,0,1,1,0,1,0,1,1,1,1,1,0,1,0,1,1,0,1]
row8 =[1,0,0,0,0,1,0,1,1,1,1,1,0,1,0,0,0,0,1]
row9 =[1,1,1,1,0,1,0,0,0,1,0,0,0,1,0,1,1,1,1]
row10=[3,3,3,1,0,1,1,1,0,1,0,1,1,1,0,1,3,3,3]
row11=[3,3,3,1,0,1,0,0,0,0,0,0,0,1,0,1,3,3,3]
row12=[3,3,3,1,0,1,0,1,4,4,4,1,0,1,0,1,3,3,3]
row13=[1,1,1,1,0,1,0,1,3,3,3,1,0,1,0,1,1,1,1]
row14=[3,3,3,3,0,0,0,1,3,3,3,1,0,0,0,3,3,3,3]
row15=[1,1,1,1,0,1,0,1,5,5,5,1,0,1,0,1,1,1,1]
row16=[3,3,3,1,0,1,0,3,3,3,3,3,0,1,0,1,3,3,3]
row17=[3,3,3,1,0,1,0,1,1,1,1,1,0,1,0,1,3,3,3]
row18=[3,3,3,1,0,1,0,1,1,1,1,1,0,1,0,1,3,3,3]
row19=[1,1,1,1,0,0,0,0,0,1,0,0,0,0,0,1,1,1,1]
row20=[1,0,0,0,0,1,1,1,0,1,0,1,1,1,0,0,0,0,1]
row21=[1,0,1,1,0,0,0,0,0,3,0,0,0,0,0,1,1,0,1]
row22=[1,0,1,1,0,1,0,1,1,1,1,1,0,1,0,1,1,0,1]
row23=[1,2,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,2,1]
row24=[1,0,1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,0,1]
row25=[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1]
row26=[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
maze = [row1,row2,row3,row4,row5,row6,row7,row8,row9,row10,row11,row12,
row13,row14,row15,row16,row17,row18,row19,row20,row21,row22,
row23,row24,row25,row26]
So I have tried if 0 not in maze:
But the if statement will execute whether 0 is in (maze) or not.
Any help would be appreciated, thanks.