Skip to content

Python projects

Python projects pack

Six complete projects that turn Python basics into real programs. Each one has steps, starter code and a stretch idea.

A learner building a Python project

How to use the projects

Each project uses skills from the starter pack. Plan first: write down what the program should do, then build it a step at a time, running it after each step.

1. Quiz master

Store questions and answers in two lists, ask each one and keep score.

questions = ["Capital of France?", "5 x 6?", "Binary for 3?"]
answers = ["paris", "30", "11"]
score = 0
for i in range(len(questions)):
    reply = input(questions[i] + " ").lower()
    if reply == answers[i]:
        score = score + 1
print("You scored", score, "out of", len(questions))

Stretch: shuffle the questions with random.shuffle.

2. Password strength checker

Check the length and whether the password contains a number and a capital letter. Rate it weak, medium or strong.

pw = input("Password: ")
points = 0
if len(pw) >= 8: points += 1
if any(c.isdigit() for c in pw): points += 1
if any(c.isupper() for c in pw): points += 1
print(["Weak", "Weak", "Medium", "Strong"][points])

3. Higher or lower

Show a random card from 1 to 13. The player guesses if the next is higher or lower. Keep going until they are wrong, then show their streak.

4. Dice statistics

Roll two dice 1,000 times and count how often each total from 2 to 12 appears, using a list of counts. Which total is most common, and why?

5. Caesar cipher

Shift each letter of a message along the alphabet by a key to encrypt it, and back again to decrypt.

def shift(text, key):
    result = ""
    for ch in text.upper():
        if ch.isalpha():
            result += chr((ord(ch) - 65 + key) % 26 + 65)
        else:
            result += ch
    return result

print(shift("HELLO", 3))   # KHOOR

6. High score table

Save names and scores to a text file, then read them back and show the top five in order. This is great practice for file handling questions.

with open("scores.txt", "a") as f:
    f.write(name + "," + str(score) + "\n")

Skills covered

ProjectKey skills
Quiz masterLists, loops, selection
Password checkerString handling, validation
Higher or lowerRandom numbers, while loops
Dice statisticsLists, counting, iteration
Caesar cipherFunctions, ASCII, MOD
High score tableFile handling, sorting

Questions

Common questions

Are these suitable for GCSE?

Yes. They practise the programming skills tested in GCSE Computer Science papers, especially string handling, lists and files.

What if my code doesn't work?

Use the Python Emergency Kit, and add print() lines to see what each variable holds.

Can Dee help with projects?

Yes, in one to one Python lessons.

Want help with this one to one?

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

Send an enquiry