maze game - previous said walls was not defined until I moved walls=[] out of the game loop(while True:)
class Wall (object):
def __init__(self,pos):
walls.append(self)
self.rect = pygame.Rect(pos[0], pos[1], 16, 16)
x = 0
y = 0
for row in level:
for col in row:
if col == 'W':
Wall((x, y))
if col == "E":
end_rect = pygame.Rect (x, y,16,16)
x = x + 16
y = y + 16
x = 0