python - Adding a dictionary inside a dictionary error -
i used answer here: syntax creating dictionary dictionary in python base used.
i, however, syntax error , can't see why.
player.image_dict = {( 0,2,0,0,0,0): {'idle' : itertools.cycle [(pygame.image.load("images/egg_1.png"), pygame.image.load("images/egg_2.png"), pygame.image.load("images/egg_3.png")] }, ( 2,4,0,0,2,5): {'idle' : itertools.cycle ([pygame.image.load("images/leaf_1.png"), pygame.image.load("images/leaf_2.png"), pygame.image.load("images/leaf_3.png"), pygame.image.load("images/leaf_4.png")])}}
the syntax error refers line:
pygame.image.load("images/egg_3.png")] },
you have opening brackets wrong way round:
itertools.cycle([pygame.image.load("images/egg_1.png"), ...
and @ end:
...egg_3.png"] ) },
Comments
Post a Comment