An Introduction to Python
Python is a text-based programming language that can be used in a variety of ways. Due to its versatility Python has proven itself to be a powerful language indeed and has been used by many large companies and organisations such as Google and NASA.
We have put together a document to help with the introduction to Python. Topics covered include installing Python, explaining common errors and tips for troubleshooting problems. Click here to download.
The Python Cheat Sheet
Making the transition from Scratch to a coding language can appear daunting at first. Problems encountered in the earlier lessons can always be worked out by recreating the task in Scratch. From here the solution will become clearer. Click here to download a copy of our Scratch to Python cheat sheet.
A couple of additional guides have been produced to help form a good understanding of Python:
An Introduction to Variables in Python
Here we look at variables in greater detail and learn about their different types and uses within programming. You can download the document here.
An Introduction to Conditions, Loops and Functions in Python
This introduction builds on the previous Variables document and looks at the various ways in which conditions, loops and functions can be utilised. You can download the document here.
This game is a great introductory exercise and is cover many basic concepts. It introduces pupils to decision making as well as loops and outputting data to the screen. The aim of this simple text-based game is to choose one of three doors and hope that there isn’t a ghost hiding behind one of them. Download the commented code here.
Rock, Paper, Scissors
We visit a popular classic in the form of Rock, Paper, Scissors with this exercise. Pupils will already be familiar with the concept of this game, hopefully covering it in previous Scratch lessons with this lesson building on what was learnt in the previous Ghost Game exercise.. This Python exercise is ideal for introducing concepts such as random choices and decision making through IF statements. The commented code can be downloaded here.
This is a simple project to bring back the current weather conditions for a particular city that is specified by the user. It will require the pyowm module being installed but there are easy to follow instruction in the script’s comments. The Python code can be downloaded here.
Last month saw how we could build a simple chatbot in Scratch. This month there is the Python equivalent. Download our easy to follow and fully commented script to start building your own easily customisable chatbot here.
Scratch Motor Control
Did you know that you can control motors and lights with Scratch? First Coding has put together a simple electronics kits complete with example code to help people get up and running quickly. These kits are currently only available to subscribers and are perfect for breathing new life into any Raspberry Pi or BBC Microbit project. You can check them out in the store here.
To give an idea of how the motor control kits can be used, we found an old broken Furby toy and brought it back to life with some simple coding.
Python projects added monthly.