back

Introduction to Python

What is Python?

Python is a widely used, general purpose, text-based programming language. Python is commonly used as a first text-based language because it’s very readable and you can get things done with less code than many other languages. Python has support for turtle graphics and other modules that make coding more fun and colourful.

Python is used for real projects in industry so it’s a useful language to learn. Our projects make use of the latest version - Python 3.

Trinket

We recommend using the Trinket editor to create and run Python projects in a web browser. Trinket offers several advantages over using a text editor offline:

  • Children can see their Python code and its output side by side;
  • Children can save their code online, allowing them to access their projects both within their club and at home;
  • Children can share their projects with others, and can remix projects shared with them.

The first Python project (called About Me) explains the creating, saving and running a simple Python project in more detail.

Trinkets can be embedded in web pages, you can try the one below:

Trinket uses Python 2 by default so we need the #!/bin/python3 line to tell it to use Python 3 syntax.

Note: Saving full-featured Python 3 projects is a paid Trinket feature, but you can save projects that use #!/bin/python3 which is sufficient for Code Club projects.

A paid Trinket account is not necessary to save Code Club projects.

Code Club starter projects include the #!/bin/python3 line. To use this feature in a new project children can create a new Python (not Python 3!) trinket and add the line at the top of their script.

For general information on using Trinket in a Code Club see our Trinket Introduction and Trinket Accounts pages.