0% found this document useful (0 votes)
57 views2 pages

GCSE Python Programming Exercises

The GCSE Python Programming Workbook offers practice questions and solutions to enhance Edexcel GCSE programming skills. It covers topics such as basics and variables, loops and conditions, and functions and files. Sample questions include displaying a name, printing numbers, and file operations, along with corresponding answers provided for reference.

Uploaded by

zaydaadil13
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views2 pages

GCSE Python Programming Exercises

The GCSE Python Programming Workbook offers practice questions and solutions to enhance Edexcel GCSE programming skills. It covers topics such as basics and variables, loops and conditions, and functions and files. Sample questions include displaying a name, printing numbers, and file operations, along with corresponding answers provided for reference.

Uploaded by

zaydaadil13
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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

You might also like