Python Snake Course Lesson 3 - List and Dicts
Back to Python Snake Course Landing Page
Lesson 3 focuses on three very useful data structures: lists, tuples and dictionaries.
We use the Python code at the end of lesson 2 as a starting point. Our objective in this lessons are that the snake begins to move at last,
and looks less like a square and more like a snake.
This is the agenda:
- a very brief recap of the first two lessons and introduction to this lesson
- a short lesson to introduce dicts
- use a dict to make the if block that changes the colour of the snake to be more elegant and Pythonic
- make our snake move one square if an arrow key is pressed
- a short lesson to introduce lists and tuples
- implement our snake as a list of tuples