Skip to content

Python starter pack

Python starter pack

Everything you need for your first Python sessions: set up in minutes, then build five short programs that teach the core skills.

Python code on a laptop

Set up in five minutes

  1. Download Python free from python.org. On Windows, tick “Add Python to PATH” during installation.
  2. Open IDLE, which comes with Python, or install Thonny, a very beginner friendly editor.
  3. Choose File, New File, type your program, save it with a .py name and press F5 to run.

No install? Online editors such as Trinket or Replit run Python in a browser.

Program 1: hello you

name = input("What is your name? ")
print("Hello, " + name + "!")

Learn: input, output, variables and joining strings.

Program 2: age next year

age = int(input("How old are you? "))
print("Next year you will be", age + 1)

Learn: converting text to a number with int().

Program 3: pass or fail

score = int(input("Enter your score: "))
if score >= 50:
    print("You passed!")
else:
    print("Keep practising.")

Learn: selection with if and else, and indentation.

Program 4: times table

number = int(input("Which times table? "))
for i in range(1, 13):
    print(i, "x", number, "=", i * number)

Learn: FOR loops and range.

Program 5: guess the number

import random
secret = random.randint(1, 20)
guess = 0
while guess != secret:
    guess = int(input("Guess 1 to 20: "))
    if guess < secret:
        print("Higher")
    elif guess > secret:
        print("Lower")
print("You got it!")

Learn: WHILE loops, random numbers and elif.

Good habits from day one

  • Use meaningful variable names.
  • Run your code often, after every few lines.
  • Read error messages from the bottom line up.
  • Change one thing at a time when fixing a bug.

Got an error? The Python Emergency Kit explains the common ones. Ready for more? Try the Python projects pack.

Questions

Common questions

What age can my child start Python?

Usually from about ten, once they are comfortable typing. Younger learners often start with Scratch.

Is Python used at GCSE?

Yes, it is the most common language for GCSE Computer Science in UK schools.

Can Dee teach Python one to one?

Want help with this one to one?

Dee replies personally to every enquiry, usually within two working days.

Send an enquiry