Home | Prices | Contact Us | Courses: Power BI - Excel - Python - SQL - Generative AI - Visualising Data - Analysing Data
Back to Python Snake Course Landing Page
The London Business Analytics Group (LBAG) is running a free six-part Python foundation course over six Monday evening (6pm London time) starting 2nd June.
This is a hands-on tutorial-style foundation course in Python course over six Monday evenings. It is suitable for beginners and people who have not coded before. Over the six weeks, we design and code the snake game step by step. This is an online (on Teams) course.
The best way to learn Python is to write a classic game such as snake. This may seem a frivolous exercise compared to a more serious use case of, for example, data analysis. However, writing a game like this one forces us almost immediately to use many of the features of the language. We hope this will more fun and interesting than a more traditional approach, and more relevant especially to people who have not coded before.
In the course, we start by creating variables and constants to set up our screen and snake. We implement our snake firstly as a single square then later as a Python data structure (a list of tuples). We use list methods, such as append and pop, to create our snake. To keep our code organised and readable, we create a Snake class so that our snake can move and eat. We use looping, (with the for and while keywords) so that the snake responds to our key presses and conditional flow (with the if keyword) so that it eats and grows when it finds food. We learn how to install and import packages such as the pygame package that provides the basic 2D game functionality.
This is the first time we have run this course - expect a few bumps along the way.
Each week we build on the code that we have written in previous weeks. After each weekly session, we will publish the code that we wrote in the session available, so if you miss a session you can download the code and join the next session
The first session however is essential since we install Python, the VSCode editor, configure our Python environment and then write a tiny script to ensure that everything is set up correctly.