Home | Prices | Contact Us | Courses: Power BI - Excel - Python - SQL - Generative AI - Visualising Data - Analysing Data
Anybody who want to learn Python. This course focusses on the features of the language itself. It hopes to do this in a way that is more fun and interesting than a more traditional approach, and so possibly more relevant to people who have not coded before
This is run either as a 2 day courses, or as a series of six 2-hour sessions.
This will introduce you to Python and give you the opportunity to practice many of the features of the language: variables and constants, writing functions, creating and using classes, data structures, importing packages, looping and branching.
None. This is a beginner level course.
We will learn Python by writing the classic game of 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 start by creating variables and constants to set up our screen and snake. We implement our snake firstly as a Python data structure (a list of tuples) and use list methods such as append and pop to make our snake move. To keep our code organised and readable, we create a Snake class so that our snake can move, hiss 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.
We also use AI tools occasionally to help us with the grunt work of getting the exact correct syntax we need. But the hard thinking how to design and implement the game is up to us.
One of the good things about this case study is that it is always apparent when things have gone wrong e.g. our snake refuses to move or grow, or disappears off the screen. Testing involves playing the game a lot!
If run as a series of weekly sessions, the order is roughly
Install Python and the VSCode editor on a laptop, then create a Python environment, install some packages and write/run a tiny script to prove everything is set up properly.
We create the main code to run a game (using a popular Python package, pygame). We create our first version of the snake - which is only a single square and does not move yet.
We get our snake to change colours and to move up / down / left / right when the user presses the arrow keys on the keyboard.
Our snake takes shape and behaves more like the classic snake in the game.
The snake easts food and grows.
The game ends when the snake leaves teh screen or collides with itself. If time allows we may implement a score.
Before the course, attendees need to install Python and VSCode on their PC/ Mac. This course does need a local installation of Python. A remote installation such as Google Colab or GitHub workspaces will not work.
Here are the instructions.
Download Python from https://www.python.org/downloads/ and install on your PC/Mac.
Download VSCode from https://code.visualstudio.com/download and install on your PC/Mac.
Launch VSCode then:
Copy this Python file into the project folder.
Run the Python file. In the terminal window, type “py snake_game.py”. This should open a new window similar to the snapshot below
Close the window. You are now ready to start the course.
There is a guidance page of useful information before the course here.