The Python Starter Guide is a comprehensive reference for every Python topic in the OCR GCSE Computer Science specification. Unlike a tutorial that walks you through one concept at a time, this guide is designed to be used alongside your lessons โ look things up, check syntax, and work through the practice tasks for each topic.
If you are learning a topic for the first time, read the explanation and work through the examples yourself. Type the code โ do not copy and paste. If you are revising, use the quick reference tables and practice questions.
Every section ends with a practice task. Do it before moving on.
The OCR specification requires you to know: variables and data types, input and output, selection (if/elif/else), iteration (for and while loops), functions, lists, string manipulation, file handling, and common algorithms (searching, sorting). All are covered here.
Variables store values. Python automatically detects the data type.
# Convert to integer
age = int(input("Age: "))
# Convert to float
price = float(input("Price: "))
# Convert to string
print("Score: " + str(score))name = "Alice" print(len(name)) # 5 print(name.upper()) # ALICE print(name[0]) # A print(name[1:4]) # lic
score = int(input("Score: "))
if score >= 70:
print("Grade A")
elif score >= 60:
print("Grade B")
else:
print("Below B")
# Boolean operators
if age >= 18 and has_id:
print("Entry allowed")# For loop
for i in range(1, 6):
print(i) # 1 to 5
# While loop with input validation
password = ""
while password != "secret":
password = input("Password: ")
# Loop with list
names = ["Ana","Bob","Cal"]
for name in names:
print(name)def calculate_average(numbers):
total = 0
for n in numbers:
total += n
return total / len(numbers)
result = calculate_average([8,7,9,6])
print(result) # 7.5# Create and access scores = [8, 7, 9, 6, 10] print(scores[0]) # 8 (first item) print(scores[-1]) # 10 (last item) # Modify scores.append(9) # add to end scores.remove(7) # remove value scores.sort() # sort in place print(len(scores)) # count items
File handling appears in GCSE exams. You need to know how to open, read, write, and close files.
# Reading from a file
with open("data.txt", "r") as f:
content = f.read()
print(content)
# Reading line by line
with open("data.txt", "r") as f:
for line in f:
print(line.strip())
# Writing to a file
with open("output.txt", "w") as f:
f.write("Hello, world!\n")
f.write("Second line\n")
# Appending to a file
with open("log.txt", "a") as f:
f.write("New entry\n")Using with open() automatically closes the file when the block ends โ this is the recommended approach.
Miss ICT GCSE sessions cover every Python topic on the OCR specification. Dee works through examples, checks understanding, and focuses on the specific areas that cause problems.
You need variables, data types, input/output, selection, iteration, functions, lists, string operations, and file handling. These are all covered here and all appear in OCR GCSE exams.
Yes โ dictionaries, exception handling, and object-oriented programming are relevant at A Level but not required at GCSE. This guide covers the GCSE specification.
Write every example yourself. Then change something โ break it deliberately, then fix it. Create small programs that use each feature. Practice questions are at the end of each section.