Python is one of the most popular coding languages around. Easy to pick up, and you can quickly learn Python.

With the right resources and a Raspberry Pi computer, it is easy to learn Python. It doesn't take a beginner long to pick up the basics.

And there are lots of resources out there ready to help you learn. In this feature we've gathered together some of our favourite Python coding tutorials, websites and resources.

Get a free Pi Zero W, Official Case, and Accessories with your 12-month subscription to The MagPi. Click here for more info.

See also

Learn Python with the best video resources

The Official Raspberry Pi YouTube channel

The Official Raspberry Pi channel is packed with resources for learning to code, and almost all of them feature Python. You’ll also find advice on setting up a Raspberry Pi, plus how to make awesome things with Raspberry Pi, Python, and electronics. Be sure to subscribe!

Geek Gurl Diaries

This fantastic website offers a crash course on computer science and programming by none other than Code Club’s Carrie Anne Philbin. It covers a range of boards and technologies, but be sure to take a look at the Raspberry Pi tutorials.

Learn Python

A more advanced collection of video tutorials put together by Free Code Camp. This comprehensive course isn’t Raspberry Pi specific, but covers everything from getting started with strings all the way up to objects and inheritance.

Learn Python with Interactive websites

Raspberry Pi Education

The Raspberry Pi Education section on the official website should be your first port of call when learning anything with a Raspberry Pi, and Python is no exception. Here you’ll find tutorials, blog posts, and education resources. Sign up to the Education Newsletter while you’re there.



Future Learn

Raspberry Pi has teamed up with FutureLearn to provide interactive courses, most of which are in Python (and there’s a great Scratch to Python course). The courses are structured to last three to four weeks and only require a few hours a week to learn.

Codecademy

One of the most popular coding sites around is Codecademy. Here you sign up and learn coding techniques in an interactive web environment. It’s based on a ‘gamification’ approach, so you get points and win awards for completing code missions.



The best Python books and physical resources

Adventures in Raspberry Pi

New to Raspberry Pi? Want your children to learn coding and have fun connecting up lights, sensors, or even marshmallows? Or even use the Raspberry Pi to make a dedicated device? Then get Adventures in Raspberry Pi. Philbin is a technology educator with plenty of experience of bringing alive the Raspberry Pi’s possibilities for a young audience.

After setting up the Raspberry Pi, and learning some command-line basics, readers get to try using the Scratch programming language to animate a monkey sprite, then start building a role-playing game, before diving into turtle graphics to make shapes with both Scratch and Python. Sonic Pi continues the coding – making music with Ruby code. Throughout these divergent adventures, additional notes, definitions, and tips and tricks combine with the lessons to more broadly educate new programmers.

The last chapters are on hardware: using the GPIO with those sensors and marshmallows, and building a Pi jukebox. Readers who already have the second edition will want to know what’s new – a whole extra chapter on experimenting with cameras, and expanding your Pi’s capabilities with add-on HATs – but won’t need any persuasion to buy extra copies as Christmas presents for young relatives!

Teach Your Kids to Code

Dr Payne's Teach Your Kids to Code promises “programming so easy a parent can do it!” Starting with turtle graphics, the reader is drawn in, and Python seems natural, easy, yet still a thing of wonder.

Learners are encouraged to experiment, rather than overloaded with details of how and why – but where details are necessary, such as number types and operators, they are introduced.

As concepts are brought into play, we feed them into turtle graphics – so conditionals lead to fractal spirals, and user input selects the shape drawn.

Programming challenges at the end of each chapter – turning the High Card game into War, or adding sound effects to the Pong game – steer further learning.

Aimed at children aged nine and up, there’s enough here for everyone – parents can take younger children through some of the projects, and teens shouldn’t feel talked down to.

Payne has the balance right between giving enough in plentiful, fun projects to keep interest, and introducing programming concepts to build real understanding almost by osmosis.

Python and Pygame installation are banished to an appendix, where you’ll also find instructions on creating your own modules! And once more, delightful illustrations by Miran Lipovaca lift an already excellent No Starch book to another level. Strongly recommended for learners of all ages.

Programming The Raspberry Pi

Programming The Raspberry Pi could be the perfect introductory programming book to give to someone who’s just got a Raspberry Pi for Christmas.

With no wasted words, Monk introduces the Pi and its operating system, then teaches both Python and using Python with the Pi, in a direct and easily absorbed text that harks back to the best beginner guides of the 8-bit era.

Skip the first two dozen pages if you are not new to the Pi, and dive into Python with an introduction that – through well-chosen examples, such as a dice rolling simulation – will have you learning conditionals, control flow, and comparison operators before you know it. Next, Hangman introduces functions, as well as strings, lists, and dictionaries. OOP is touched on with a temperature converter, then file handling and GUI programming (with Tkinter) through building on the earlier code examples. The Pygame chapter makes use of many of the techniques learned, then moves on to refactoring.

The same concise style is used to cover the Pi hardware for the rest of the book: GPIO pins, breadboard prototyping, connecting an Arduino, then a range of sample projects culminating in a Raspberry Pi robot. Unreservedly recommended for confident beginners of all ages.

Head First Python

Whether or not you like the quirky, visual style of O’Reilly’s Head First books, Head First Python is an excellent introduction to Python, well written and well paced. Aimed at those with at least a little coding experience in another language, Paul Barry’s text starts iconoclastically by sidestepping Hello World and diving into a more in-depth first program, bringing in the list data structure, importing from the standard library, and introducing the powerful in operator.

The data-first approach, with lists, then dictionaries, tuples, and sets, is a firmer foundation than starting with control flows. Functions follow, and making your own modules, which you then install in the cloud at PythonAnywhere, to support the web app you write with Flask. Difficult subjects like decorators, comprehensions, and generators are painlessly introduced, as our app is constantly refactored, and communicating with an SQL database is carefully taught.

PEP8 gets an early mention, but otherwise testing is left. Nor is there anything on Jupyter or doing data science, for example, but this is a book that teaches a lot, very quickly, and confident learners who find other introductory books too slow-paced will get a head start in Python with this Head First guide.