What is Python?

Python is a widely used general-purpose, text-based programming language. It is many learners’ first text-based language because it’s very readable, and because you can get things done with fewer lines of code than in many other programming languages. In addition, Python has support for Turtle graphics and other modules that make coding more fun and colourful.

Python is used in real-world software applications in industry, so it’s very useful to learn it. Code Club projects use the latest Python version: Python 3.

Using Trinket to write Python code online

We recommend using the Trinket editor to create and run Python projects in a web browser. For general information on using Trinket in a Code Club see our Trinket introduction and Trinket accounts guides.

The first Code Club Python project (called About me) explains in more detail how to create, save, and run a simple Python program using Trinket.

Trinket uses Python 2 by default, so our Trinket starter projects always include the #!/bin/python3 line, which tells Trinket to use Python 3 syntax.

Saving full-featured Python 3 projects is a paid-for Trinket feature, but you don’t need a paid-for account for our Code Club projects: Trinket allows you to save projects that include the line #!/bin/python3, which is sufficient for Code Club projects.

Writing Python code offline

We recommend using Trinket to write Python programs online. However, if you are using computers without an internet connection or you are unable to access Trinket, you can write Python code offline.

  • Downloading and installing Python

Download version 3.2 of Python (choose the right download for your operating system), and then install it.

  • Writing and running a simple Python program in IDLE

Installing Python will also install the IDLE Python editor, which is the simplest tool for writing and running Python programs. IDLE consists of two windows: the editor (where you write your programs) and the shell (where your programs run).

IDLE Editor

While IDLE is running, you will probably see the Python Shell window.

You can open a new editor window in IDLE by clicking on File and then on New Window. Once you have written your program, you should save it; remember to add .py to the end of your file name to ensure that the file opens in the IDLE editor.