GCSE Python Programming Workbook
Introduction
This workbook provides Python practice questions and solutions to support your Edexcel GCSE
programming skills.
1. Basics and Variables
Q1: Write a program to display your name.
Q2: Store a user's age and print it back.
Q3: Swap two variable values without using a third variable.
2. Loops and Conditions
Q4: Print all numbers from 1 to 100.
Q5: Print even numbers between 10 and 50.
Q6: Write a while loop that stops when the user types 'exit'.
3. Functions and Files
Q7: Write a function that returns the square of a number.
Q8: Create a file, write 5 names into it, then read and print them.
Q9: Read numbers from a file and calculate their average.
Answers
A1: print('Your Name')
GCSE Python Programming Workbook
A4: for i in range(1, 101): print(i)
A7: def square(x): return x*x