Topic 1
What is Python?
Python is a programming language. You use it to give instructions to a computer, process information and produce useful output.
Input
->
Python code
->
Output
Programming as instructions
A program is a set of instructions. Python reads your instructions in order and follows them step by step.
print("Study tracker ready")
Real-life example: A calculator takes numbers, processes them and shows an answer.
Why this matters: It helps you build the Student Marks and Study Tracker one small idea at a time.
How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.
Key words for this subtopic| Key word | Simple meaning | Why we use it | Tiny example |
|---|
| Programming as instructions | The main idea in this part of the lesson | It gives you one building block for the final project | print("Study tracker ready") |
| example | A small sample that shows the idea | It helps you see how the concept looks in practice | print("Study tracker ready") |
| mini-project task | A small build step after the exercise | It turns the lesson into part of the Student Marks and Study Tracker | Student Marks and Study Tracker |
Quick exercise
Write down one daily task that could be split into clear instructions.
Mini-project task
Write the main instruction your tracker should perform, such as calculating a student's average score.
Where Python is used
Python is used for automation, data analysis, AI, websites, finance trackers and small tools because its syntax is readable.
task = "Calculate student average"
print(task)
Real-life example: A budget tracker takes income and expenses, then calculates the remaining balance.
Why this matters: It helps you build the Student Marks and Study Tracker one small idea at a time.
How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.
Key words for this subtopic| Key word | Simple meaning | Why we use it | Tiny example |
|---|
| Where Python is used | The main idea in this part of the lesson | It gives you one building block for the final project | task = "Calculate student average" print(task) |
| example | A small sample that shows the idea | It helps you see how the concept looks in practice | task = "Calculate student average" print(task) |
| mini-project task | A small build step after the exercise | It turns the lesson into part of the Student Marks and Study Tracker | Student Marks and Study Tracker |
Quick exercise
Name two problems you could solve with a small Python script.
Mini-project task
List two ways a Student Marks and Study Tracker could help a learner revise.
Input, process and output thinking
Useful programs usually start with input, perform a process and show output. This keeps your idea focused before you write code.
score = 78
target = 70
print(score >= target)
Real-life example: A marks tracker takes student marks, calculates a percentage and gives a result.
Why this matters: It helps you build the Student Marks and Study Tracker one small idea at a time.
How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.
Key words for this subtopic| Key word | Simple meaning | Why we use it | Tiny example |
|---|
| Input, process and output thinking | The main idea in this part of the lesson | It gives you one building block for the final project | score = 78 target = 70 print(score >= target) |
| example | A small sample that shows the idea | It helps you see how the concept looks in practice | score = 78 target = 70 print(score >= target) |
| mini-project task | A small build step after the exercise | It turns the lesson into part of the Student Marks and Study Tracker | Student Marks and Study Tracker |
Quick exercise
Write one input, one process and one output for a marks tracker.
Mini-project task
For your tracker, write what the input will be, what Python should calculate and what output the user should see.
Topic checkpoint
Every useful program usually starts with input, processing and output. Your project idea now has a clear purpose.
Topic 2
Variables and data types
Variables store values so you can use them later. Data types describe the kind of value you are storing.
Data value
->
Variable name
->
Used later
Variables
A variable is a name that points to a value. Choose names that explain what the value means.
student_name = "Aisha"
maths_score = 78
Real-life example: A tracker stores a student name and the student's latest Maths mark.
Beginner mistake to avoid
Avoid unclear names such as x when maths_score explains the value better.
Why this matters: It helps you build the Student Marks and Study Tracker one small idea at a time.
How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.
Key words for this subtopic| Key word | Simple meaning | Why we use it | Tiny example |
|---|
| Variables | The main idea in this part of the lesson | It gives you one building block for the final project | student_name = "Aisha" maths_score = 78 |
| example | A small sample that shows the idea | It helps you see how the concept looks in practice | student_name = "Aisha" maths_score = 78 |
| mini-project task | A small build step after the exercise | It turns the lesson into part of the Student Marks and Study Tracker | Student Marks and Study Tracker |
Quick exercise
Create three meaningful variable names for a revision tracker.
Mini-project task
Create variables for student name, Maths mark and Python mark.
Strings and numbers
Strings store text. Integers store whole numbers. Floats store decimal numbers.
student_name = "Aisha"
maths_score = 78
attendance_rate = 92.5
Real-life example: A student profile can store a name, exam score and attendance percentage.
Beginner mistake to avoid
Do not put numbers in quotes if you need to calculate with them. "78" is text, but 78 is a number.
Why this matters: It helps you build the Student Marks and Study Tracker one small idea at a time.
How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.
Key words for this subtopic| Key word | Simple meaning | Why we use it | Tiny example |
|---|
| Strings and numbers | The main idea in this part of the lesson | It gives you one building block for the final project | student_name = "Aisha" maths_score = 78 attendance_... |
| example | A small sample that shows the idea | It helps you see how the concept looks in practice | student_name = "Aisha" maths_score = 78 attendance_... |
| mini-project task | A small build step after the exercise | It turns the lesson into part of the Student Marks and Study Tracker | Student Marks and Study Tracker |
Quick exercise
Identify which values are strings, integers or floats: "SQL", 82, 64.5.
Mini-project task
Add a target percentage variable, such as target_percentage = 70.
Booleans
Booleans store True or False. They are useful for yes/no decisions.
wants_project_recommendation = True
passed_maths = False
Real-life example: A tracker can store whether the learner wants a project recommendation.
Beginner mistake to avoid
In Python, True and False start with capital letters.
Why this matters: It helps you build the Student Marks and Study Tracker one small idea at a time.
How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.
Key words for this subtopic| Key word | Simple meaning | Why we use it | Tiny example |
|---|
| Booleans | The main idea in this part of the lesson | It gives you one building block for the final project | True |
| example | A small sample that shows the idea | It helps you see how the concept looks in practice | True |
| mini-project task | A small build step after the exercise | It turns the lesson into part of the Student Marks and Study Tracker | Student Marks and Study Tracker |
Quick exercise
Write one boolean variable for whether a student has completed revision.
Mini-project task
Create wants_project_recommendation and set it to True or False.
Type conversion
Type conversion changes a value from one type to another, such as text input into a number.
score_text = "78"
score_number = int(score_text)
Real-life example: If a user types a mark into a program, Python may receive it as text first.
Beginner mistake to avoid
Convert input before doing maths, otherwise Python may treat the value as text.
Why this matters: It helps you build the Student Marks and Study Tracker one small idea at a time.
How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.
Key words for this subtopic| Key word | Simple meaning | Why we use it | Tiny example |
|---|
| Type conversion | The main idea in this part of the lesson | It gives you one building block for the final project | score_text = "78" score_number = int(score_text) |
| example | A small sample that shows the idea | It helps you see how the concept looks in practice | score_text = "78" score_number = int(score_text) |
| mini-project task | A small build step after the exercise | It turns the lesson into part of the Student Marks and Study Tracker | Student Marks and Study Tracker |
Quick exercise
What function would convert "92.5" into a decimal number?
Mini-project task
Write a note explaining which tracker values should be text and which should be numbers.
Topic checkpoint
You now have the first stored values for the Student Marks and Study Tracker: name, marks, target percentage and a recommendation choice.
Topic 3
Operators and expressions
Operators combine or compare values. Expressions use values and operators to produce a result.
Marks
->
Calculation
->
Percentage
Arithmetic operators
Arithmetic operators include addition, subtraction, multiplication and division.
total_score = maths_score + python_score
average_score = total_score / 2
Real-life example: A marks tracker calculates average score from multiple subject marks.
Beginner mistake to avoid
Use brackets when an expression needs a clear order.
Why this matters: It helps you build the Student Marks and Study Tracker one small idea at a time.
How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.
Key words for this subtopic| Key word | Simple meaning | Why we use it | Tiny example |
|---|
| Arithmetic operators | The main idea in this part of the lesson | It gives you one building block for the final project | total_score = maths_score + python_score average_sc... |
| example | A small sample that shows the idea | It helps you see how the concept looks in practice | total_score = maths_score + python_score average_sc... |
| mini-project task | A small build step after the exercise | It turns the lesson into part of the Student Marks and Study Tracker | Student Marks and Study Tracker |
Quick exercise
Calculate the average of 80 and 70 using Python-style arithmetic.
Mini-project task
Calculate total score and average score for Maths and Python.
Comparison operators
Comparison operators check relationships, such as whether one value is greater than another.
is_ready = average_score >= 70
Real-life example: A tracker checks whether a student met the target percentage.
Beginner mistake to avoid
Use == to compare values. A single = assigns a value.
Why this matters: It helps you build the Student Marks and Study Tracker one small idea at a time.
How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.
Key words for this subtopic| Key word | Simple meaning | Why we use it | Tiny example |
|---|
| Comparison operators | The main idea in this part of the lesson | It gives you one building block for the final project | is_ready = average_score >= 70 |
| example | A small sample that shows the idea | It helps you see how the concept looks in practice | is_ready = average_score >= 70 |
| mini-project task | A small build step after the exercise | It turns the lesson into part of the Student Marks and Study Tracker | Student Marks and Study Tracker |
Quick exercise
Write a comparison that checks whether attendance_rate is at least 90.
Mini-project task
Create a variable that stores whether the average score meets the target percentage.
Logical operators
Logical operators combine conditions. Common ones are and, or and not.
strong_attendance = attendance_rate >= 90
ready_and_consistent = is_ready and strong_attendance
Real-life example: A learner may be considered consistent if both score and attendance are strong.
Beginner mistake to avoid
Do not write every condition in one long line. Break complex logic into named variables.
Why this matters: It helps you build the Student Marks and Study Tracker one small idea at a time.
How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.
Key words for this subtopic| Key word | Simple meaning | Why we use it | Tiny example |
|---|
| Logical operators | The main idea in this part of the lesson | It gives you one building block for the final project | and |
| example | A small sample that shows the idea | It helps you see how the concept looks in practice | and |
| mini-project task | A small build step after the exercise | It turns the lesson into part of the Student Marks and Study Tracker | Student Marks and Study Tracker |
Quick exercise
Write a condition that checks if score is at least 70 and revision is complete.
Mini-project task
Add a second condition that checks whether the student is ready and wants a project recommendation.
Calculating percentages
Percentages are useful when the total possible marks are known.
marks_earned = 145
marks_possible = 200
percentage = (marks_earned / marks_possible) * 100
Real-life example: Exam marks can be converted to a percentage so results are easier to compare.
Beginner mistake to avoid
Remember to multiply by 100 after dividing earned marks by possible marks.
Why this matters: It helps you build the Student Marks and Study Tracker one small idea at a time.
How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.
Key words for this subtopic| Key word | Simple meaning | Why we use it | Tiny example |
|---|
| Calculating percentages | The main idea in this part of the lesson | It gives you one building block for the final project | marks_earned = 145 marks_possible = 200 percentage ... |
| example | A small sample that shows the idea | It helps you see how the concept looks in practice | marks_earned = 145 marks_possible = 200 percentage ... |
| mini-project task | A small build step after the exercise | It turns the lesson into part of the Student Marks and Study Tracker | Student Marks and Study Tracker |
Quick exercise
What percentage is 36 out of 60?
Mini-project task
Decide whether your tracker will store raw marks, percentages or both.
Topic checkpoint
You can now calculate the basic readiness score for the mini project and compare it with a target.
Topic 4
Conditions
Conditions let a program choose different paths depending on whether something is true or false.
Start
->
Check score
->
Strong / Developing / Needs focus
->
Show result
if statements
An if statement runs code only when a condition is true.
if average_score >= 80:
print("Strong")
Real-life example: A tracker can print a strong result when a score is high.
Beginner mistake to avoid
Do not forget the colon after the condition.
Why this matters: It helps you build the Student Marks and Study Tracker one small idea at a time.
How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.
Key words for this subtopic| Key word | Simple meaning | Why we use it | Tiny example |
|---|
| if statements | The main idea in this part of the lesson | It gives you one building block for the final project | if |
| example | A small sample that shows the idea | It helps you see how the concept looks in practice | if |
| mini-project task | A small build step after the exercise | It turns the lesson into part of the Student Marks and Study Tracker | Student Marks and Study Tracker |
Quick exercise
Write an if statement that checks whether maths_score is at least 60.
Mini-project task
Add an if check for scores of 80 or above.
if / else
else gives Python another path when the if condition is false.
if average_score >= target_percentage:
print("Target met")
else:
print("Target not met yet")
Real-life example: A student sees whether they passed a target or need more revision.
Beginner mistake to avoid
Keep the indentation consistent under both if and else.
Why this matters: It helps you build the Student Marks and Study Tracker one small idea at a time.
How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.
Key words for this subtopic| Key word | Simple meaning | Why we use it | Tiny example |
|---|
| if / else | The main idea in this part of the lesson | It gives you one building block for the final project | else |
| example | A small sample that shows the idea | It helps you see how the concept looks in practice | else |
| mini-project task | A small build step after the exercise | It turns the lesson into part of the Student Marks and Study Tracker | Student Marks and Study Tracker |
Quick exercise
Write an if / else that prints pass or revise.
Mini-project task
Add a target message to your tracker using if / else.
elif for multiple outcomes
elif means "else if". It lets you check another condition before the final else.
if average_score >= 80:
level = "Strong"
elif average_score >= 60:
level = "Developing"
else:
level = "Needs focus"
Real-life example: Readiness can be grouped into strong, developing and needs focus.
Beginner mistake to avoid
Put the highest condition first, otherwise a lower condition may catch the score too early.
Why this matters: It helps you build the Student Marks and Study Tracker one small idea at a time.
How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.
Key words for this subtopic| Key word | Simple meaning | Why we use it | Tiny example |
|---|
| elif for multiple outcomes | The main idea in this part of the lesson | It gives you one building block for the final project | elif |
| example | A small sample that shows the idea | It helps you see how the concept looks in practice | elif |
| mini-project task | A small build step after the exercise | It turns the lesson into part of the Student Marks and Study Tracker | Student Marks and Study Tracker |
Quick exercise
What level should a score of 72 receive using this logic?
Mini-project task
Add readiness levels: 80+ Strong, 60-79 Developing, below 60 Needs focus.
Conditions in real projects
Conditions make projects feel useful because the program responds to different situations.
if level == "Needs focus":
next_step = "Revise the lowest scoring subject"
else:
next_step = "Build a small project"
Real-life example: A budget app can warn when spending is higher than income.
Beginner mistake to avoid
Keep decision rules simple first. Add more detail only after the basic version works.
Why this matters: It helps you build the Student Marks and Study Tracker one small idea at a time.
How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.
Key words for this subtopic| Key word | Simple meaning | Why we use it | Tiny example |
|---|
| Conditions in real projects | The main idea in this part of the lesson | It gives you one building block for the final project | if level == "Needs focus": next_step = "Revise the ... |
| example | A small sample that shows the idea | It helps you see how the concept looks in practice | if level == "Needs focus": next_step = "Revise the ... |
| mini-project task | A small build step after the exercise | It turns the lesson into part of the Student Marks and Study Tracker | Student Marks and Study Tracker |
Quick exercise
Write one rule your tracker should use to suggest revision.
Mini-project task
Create a next_step message based on the readiness level.
Topic checkpoint
You now have a program that gives a simple level and next step based on marks.
Topic 5
Loops
Loops repeat tasks, which helps you process several values without writing the same code again and again.
Start
->
Read next item
->
Process item
->
More items?
->
Stop
Why loops are useful
A loop helps when the same action must happen for many items.
scores = [78, 65, 82, 71]
for score in scores:
print(score)
Real-life example: A tracker can print every subject score in a list.
Beginner mistake to avoid
Do not copy and paste the same print line for every score. Use a loop.
Why this matters: It helps you build the Student Marks and Study Tracker one small idea at a time.
How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.
Key words for this subtopic| Key word | Simple meaning | Why we use it | Tiny example |
|---|
| Why loops are useful | The main idea in this part of the lesson | It gives you one building block for the final project | scores = [78, 65, 82, 71] for score in scores: prin... |
| example | A small sample that shows the idea | It helps you see how the concept looks in practice | scores = [78, 65, 82, 71] for score in scores: prin... |
| mini-project task | A small build step after the exercise | It turns the lesson into part of the Student Marks and Study Tracker | Student Marks and Study Tracker |
Quick exercise
Name one task where repeating the same action would be useful.
Mini-project task
Create a short list of subject scores and print each score.
for loops
A for loop is useful when you know the list of items you want to process.
for score in scores:
if score < 60:
print("Needs revision")
Real-life example: Checking every job application status in a list.
Beginner mistake to avoid
The loop body must be indented so Python knows what should repeat.
Why this matters: It helps you build the Student Marks and Study Tracker one small idea at a time.
How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.
Key words for this subtopic| Key word | Simple meaning | Why we use it | Tiny example |
|---|
| for loops | The main idea in this part of the lesson | It gives you one building block for the final project | for |
| example | A small sample that shows the idea | It helps you see how the concept looks in practice | for |
| mini-project task | A small build step after the exercise | It turns the lesson into part of the Student Marks and Study Tracker | Student Marks and Study Tracker |
Quick exercise
Write a loop that prints every item in a shopping list.
Mini-project task
Loop through scores and print whether each score is below 60.
while loops
A while loop repeats while a condition stays true.
attempts = 0
while attempts < 3:
print("Practise again")
attempts = attempts + 1
Real-life example: A study app could remind a learner to practise until a target is reached.
Beginner mistake to avoid
Avoid infinite loops by making sure the condition can eventually become false.
Why this matters: It helps you build the Student Marks and Study Tracker one small idea at a time.
How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.
Key words for this subtopic| Key word | Simple meaning | Why we use it | Tiny example |
|---|
| while loops | The main idea in this part of the lesson | It gives you one building block for the final project | while |
| example | A small sample that shows the idea | It helps you see how the concept looks in practice | while |
| mini-project task | A small build step after the exercise | It turns the lesson into part of the Student Marks and Study Tracker | Student Marks and Study Tracker |
Quick exercise
What line changes the value of attempts in the example?
Mini-project task
Write a note on where a while loop could be useful in future versions of the tracker.
Looping through student marks
Loops make it easier to process several marks and identify weak subjects.
for score in scores:
print("Score:", score)
Real-life example: A student checks marks for Maths, Python, SQL and Communication.
Beginner mistake to avoid
Do not change the list while you are still learning to loop through it. Keep the first version simple.
Why this matters: It helps you build the Student Marks and Study Tracker one small idea at a time.
How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.
Key words for this subtopic| Key word | Simple meaning | Why we use it | Tiny example |
|---|
| Looping through student marks | The main idea in this part of the lesson | It gives you one building block for the final project | for score in scores: print("Score:", score) |
| example | A small sample that shows the idea | It helps you see how the concept looks in practice | for score in scores: print("Score:", score) |
| mini-project task | A small build step after the exercise | It turns the lesson into part of the Student Marks and Study Tracker | Student Marks and Study Tracker |
Quick exercise
How many times will this loop run if the list has four scores?
Mini-project task
Use a loop to print every score in your tracker.
Topic checkpoint
You now understand how to process multiple scores instead of only one.
Topic 6
Lists
Lists store multiple values in one variable, such as subjects, scores or tasks.
0 Maths
1 Python
2 SQL
Creating lists
Create a list with square brackets and separate values with commas.
subjects = ["Maths", "Python", "SQL"]
scores = [78, 65, 72]
Real-life example: A marks tracker stores a list of subjects and a list of scores.
Beginner mistake to avoid
Use square brackets for a list, not quotation marks around the whole list.
Why this matters: It helps you build the Student Marks and Study Tracker one small idea at a time.
How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.
Key words for this subtopic| Key word | Simple meaning | Why we use it | Tiny example |
|---|
| Creating lists | The main idea in this part of the lesson | It gives you one building block for the final project | subjects = ["Maths", "Python", "SQL"] scores = [78,... |
| example | A small sample that shows the idea | It helps you see how the concept looks in practice | subjects = ["Maths", "Python", "SQL"] scores = [78,... |
| mini-project task | A small build step after the exercise | It turns the lesson into part of the Student Marks and Study Tracker | Student Marks and Study Tracker |
Quick exercise
Create a list of three revision topics.
Mini-project task
Create a list of subjects and a matching list of scores.
Accessing list values
List positions start at index 0. The first item is at position 0.
first_subject = subjects[0]
first_score = scores[0]
Real-life example: A tracker can access the first subject and first score to display them.
Beginner mistake to avoid
Do not forget that Python starts counting list indexes from 0.
Why this matters: It helps you build the Student Marks and Study Tracker one small idea at a time.
How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.
Key words for this subtopic| Key word | Simple meaning | Why we use it | Tiny example |
|---|
| Accessing list values | The main idea in this part of the lesson | It gives you one building block for the final project | first_subject = subjects[0] first_score = scores[0] |
| example | A small sample that shows the idea | It helps you see how the concept looks in practice | first_subject = subjects[0] first_score = scores[0] |
| mini-project task | A small build step after the exercise | It turns the lesson into part of the Student Marks and Study Tracker | Student Marks and Study Tracker |
Quick exercise
Which index would access "SQL" in ["Maths", "Python", "SQL"]?
Mini-project task
Print the first subject and first score from your lists.
Adding and removing values
Lists can change. You can add items with append() and remove items with methods such as remove().
subjects.append("Communication")
scores.append(75)
Real-life example: A learner adds Communication after deciding to practise presentation skills.
Beginner mistake to avoid
If you add a subject, remember to add the matching score too.
Why this matters: It helps you build the Student Marks and Study Tracker one small idea at a time.
How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.
Key words for this subtopic| Key word | Simple meaning | Why we use it | Tiny example |
|---|
| Adding and removing values | The main idea in this part of the lesson | It gives you one building block for the final project | append() |
| example | A small sample that shows the idea | It helps you see how the concept looks in practice | append() |
| mini-project task | A small build step after the exercise | It turns the lesson into part of the Student Marks and Study Tracker | Student Marks and Study Tracker |
Quick exercise
Add one more item to a list of tasks.
Mini-project task
Add one extra subject and score to your tracker lists.
Using lists in a marks tracker
You can loop through list indexes to print subjects and scores together.
for index in range(len(subjects)):
print(subjects[index], scores[index])
Real-life example: A report shows Maths 78, Python 65 and SQL 72.
Beginner mistake to avoid
Keep related lists the same length, otherwise indexes may not match.
Why this matters: It helps you build the Student Marks and Study Tracker one small idea at a time.
How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.
Key words for this subtopic| Key word | Simple meaning | Why we use it | Tiny example |
|---|
| Using lists in a marks tracker | The main idea in this part of the lesson | It gives you one building block for the final project | for index in range(len(subjects)): print(subjects[i... |
| example | A small sample that shows the idea | It helps you see how the concept looks in practice | for index in range(len(subjects)): print(subjects[i... |
| mini-project task | A small build step after the exercise | It turns the lesson into part of the Student Marks and Study Tracker | Student Marks and Study Tracker |
Quick exercise
Why should the subjects list and scores list have the same number of items?
Mini-project task
Use a loop to print each subject and score together.
Topic checkpoint
You now have a basic multi-subject tracker using lists and loops.
Topic 7
Functions
Functions package reusable logic so your program is easier to read, test and improve.
Input scores
->
Function
->
Average result
Why functions are useful
A function gives a name to a task, so you can reuse it instead of rewriting the same code.
def say_ready():
print("Tracker ready")
Real-life example: A discount calculator can reuse the same formula for many products.
Beginner mistake to avoid
Define the function before you try to call it.
Why this matters: It helps you build the Student Marks and Study Tracker one small idea at a time.
How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.
Key words for this subtopic| Key word | Simple meaning | Why we use it | Tiny example |
|---|
| Why functions are useful | The main idea in this part of the lesson | It gives you one building block for the final project | def say_ready(): print("Tracker ready") |
| example | A small sample that shows the idea | It helps you see how the concept looks in practice | def say_ready(): print("Tracker ready") |
| mini-project task | A small build step after the exercise | It turns the lesson into part of the Student Marks and Study Tracker | Student Marks and Study Tracker |
Quick exercise
Name one calculation that would be useful as a function.
Mini-project task
Plan a function called calculate_average.
Parameters
Parameters are inputs a function receives.
def calculate_average(scores):
return sum(scores) / len(scores)
Real-life example: A function receives a list of scores and calculates the average.
Beginner mistake to avoid
Use parameter names that explain what the function expects.
Why this matters: It helps you build the Student Marks and Study Tracker one small idea at a time.
How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.
Key words for this subtopic| Key word | Simple meaning | Why we use it | Tiny example |
|---|
| Parameters | The main idea in this part of the lesson | It gives you one building block for the final project | def calculate_average(scores): return sum(scores) /... |
| example | A small sample that shows the idea | It helps you see how the concept looks in practice | def calculate_average(scores): return sum(scores) /... |
| mini-project task | A small build step after the exercise | It turns the lesson into part of the Student Marks and Study Tracker | Student Marks and Study Tracker |
Quick exercise
What parameter does calculate_average(scores) receive?
Mini-project task
Create calculate_average(scores) for your tracker.
Return values
return sends a result back from a function so the rest of the program can use it.
average = calculate_average(scores)
print(average)
Real-life example: A function calculates an average, then another part of the program decides the readiness level.
Beginner mistake to avoid
print() displays a value, but return gives it back to the program.
Why this matters: It helps you build the Student Marks and Study Tracker one small idea at a time.
How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.
Key words for this subtopic| Key word | Simple meaning | Why we use it | Tiny example |
|---|
| Return values | The main idea in this part of the lesson | It gives you one building block for the final project | return |
| example | A small sample that shows the idea | It helps you see how the concept looks in practice | return |
| mini-project task | A small build step after the exercise | It turns the lesson into part of the Student Marks and Study Tracker | Student Marks and Study Tracker |
Quick exercise
Explain the difference between printing a value and returning a value.
Mini-project task
Store the returned average in a variable called average_score.
Reusing functions in the project
Once functions are written, you can call them whenever the tracker needs a result.
def get_readiness_level(average):
if average >= 80:
return "Strong"
if average >= 60:
return "Developing"
return "Needs focus"
Real-life example: A report function can print the same style of summary for different students.
Beginner mistake to avoid
Keep each function focused on one job.
Why this matters: It helps you build the Student Marks and Study Tracker one small idea at a time.
How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.
Key words for this subtopic| Key word | Simple meaning | Why we use it | Tiny example |
|---|
| Reusing functions in the project | The main idea in this part of the lesson | It gives you one building block for the final project | def get_readiness_level(average): if average >= 80:... |
| example | A small sample that shows the idea | It helps you see how the concept looks in practice | def get_readiness_level(average): if average >= 80:... |
| mini-project task | A small build step after the exercise | It turns the lesson into part of the Student Marks and Study Tracker | Student Marks and Study Tracker |
Quick exercise
What should get_readiness_level(85) return?
Mini-project task
Create get_readiness_level(average) and print_student_report(name, average, level).
Topic checkpoint
You now have reusable blocks for calculating averages, choosing a level and printing a report.
Topic 8
Dictionaries
Dictionaries store labelled values as key-value pairs. They are useful for structured records.
nameAisha
subjectsMaths, Python, SQL
scores78, 65, 72
Key-value pairs
A dictionary connects each key to a value.
student = {
"name": "Aisha",
"score": 82
}
Real-life example: A student profile stores labels such as name, score and status.
Beginner mistake to avoid
Use quotes around text keys, such as "name".
Why this matters: It helps you build the Student Marks and Study Tracker one small idea at a time.
How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.
Key words for this subtopic| Key word | Simple meaning | Why we use it | Tiny example |
|---|
| Key-value pairs | The main idea in this part of the lesson | It gives you one building block for the final project | student = { "name": "Aisha", "score": 82 } |
| example | A small sample that shows the idea | It helps you see how the concept looks in practice | student = { "name": "Aisha", "score": 82 } |
| mini-project task | A small build step after the exercise | It turns the lesson into part of the Student Marks and Study Tracker | Student Marks and Study Tracker |
Quick exercise
Write a dictionary key for a student's target score.
Mini-project task
Start a student dictionary with name, subjects and scores.
Accessing dictionary values
Use a key in square brackets to access a value.
print(student["name"])
print(student["score"])
Real-life example: A tracker uses the name from the student record when printing the report.
Beginner mistake to avoid
Typing the wrong key name causes an error, so keep key names consistent.
Why this matters: It helps you build the Student Marks and Study Tracker one small idea at a time.
How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.
Key words for this subtopic| Key word | Simple meaning | Why we use it | Tiny example |
|---|
| Accessing dictionary values | The main idea in this part of the lesson | It gives you one building block for the final project | print(student["name"]) print(student["score"]) |
| example | A small sample that shows the idea | It helps you see how the concept looks in practice | print(student["name"]) print(student["score"]) |
| mini-project task | A small build step after the exercise | It turns the lesson into part of the Student Marks and Study Tracker | Student Marks and Study Tracker |
Quick exercise
How would you access the value stored under "subjects"?
Mini-project task
Print the student's name from the dictionary.
Updating dictionary values
You can add or update values by assigning a value to a key.
student["level"] = "Developing"
Real-life example: After calculating average score, the tracker stores the readiness level.
Beginner mistake to avoid
Be careful not to overwrite a value unless that is what you intend.
Why this matters: It helps you build the Student Marks and Study Tracker one small idea at a time.
How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.
Key words for this subtopic| Key word | Simple meaning | Why we use it | Tiny example |
|---|
| Updating dictionary values | The main idea in this part of the lesson | It gives you one building block for the final project | student["level"] = "Developing" |
| example | A small sample that shows the idea | It helps you see how the concept looks in practice | student["level"] = "Developing" |
| mini-project task | A small build step after the exercise | It turns the lesson into part of the Student Marks and Study Tracker | Student Marks and Study Tracker |
Quick exercise
Add a key called "next_step" to a dictionary.
Mini-project task
Store the calculated readiness level inside the student dictionary.
Using dictionaries for student records
A dictionary can group related project data so the program is easier to manage.
student = {
"name": "Aisha",
"subjects": ["Maths", "Python", "SQL"],
"scores": [78, 65, 72]
}
Real-life example: Product records, job applications and customer details can all be stored as dictionaries.
Beginner mistake to avoid
Do not make one dictionary too complicated at the start. Store only the data you need.
Why this matters: It helps you build the Student Marks and Study Tracker one small idea at a time.
How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.
Key words for this subtopic| Key word | Simple meaning | Why we use it | Tiny example |
|---|
| Using dictionaries for student records | The main idea in this part of the lesson | It gives you one building block for the final project | student = { "name": "Aisha", "subjects": ["Maths", ... |
| example | A small sample that shows the idea | It helps you see how the concept looks in practice | student = { "name": "Aisha", "subjects": ["Maths", ... |
| mini-project task | A small build step after the exercise | It turns the lesson into part of the Student Marks and Study Tracker | Student Marks and Study Tracker |
Quick exercise
What three values would you store in a job application record?
Mini-project task
Store the student name, subjects and scores in one dictionary.
Topic checkpoint
You now have a more realistic data structure for the Student Marks and Study Tracker.
Topic 9
Files and CSV basics
Files store data outside the program. CSV files are common in data analysis because they store rows and columns as plain text.
CSV file
->
Python reads rows
->
Calculate summary
->
Show report
What files are used for
Files let a program read data that was saved earlier or write output for later use.
with open("marks.txt", "r") as file:
content = file.read()
print(content)
Real-life example: A learner saves marks in a file instead of typing them again every time.
Beginner mistake to avoid
Check the file name and location carefully if Python cannot find the file.
Why this matters: It helps you build the Student Marks and Study Tracker one small idea at a time.
How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.
Key words for this subtopic| Key word | Simple meaning | Why we use it | Tiny example |
|---|
| What files are used for | The main idea in this part of the lesson | It gives you one building block for the final project | with open("marks.txt", "r") as file: content = file... |
| example | A small sample that shows the idea | It helps you see how the concept looks in practice | with open("marks.txt", "r") as file: content = file... |
| mini-project task | A small build step after the exercise | It turns the lesson into part of the Student Marks and Study Tracker | Student Marks and Study Tracker |
Quick exercise
Name one type of project data that would be useful to save in a file.
Mini-project task
Decide what data your tracker could save later.
What CSV means
CSV means comma-separated values. Each line is usually a row, and commas separate columns.
student_name,subject,score
Aisha,Maths,78
Aisha,Python,65
Real-life example: marks.csv, budget.csv and job_applications.csv can all hold tabular data.
Beginner mistake to avoid
Keep the same column order on every row.
Why this matters: It helps you build the Student Marks and Study Tracker one small idea at a time.
How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.
Key words for this subtopic| Key word | Simple meaning | Why we use it | Tiny example |
|---|
| What CSV means | The main idea in this part of the lesson | It gives you one building block for the final project | student_name,subject,score Aisha,Maths,78 Aisha,Pyt... |
| example | A small sample that shows the idea | It helps you see how the concept looks in practice | student_name,subject,score Aisha,Maths,78 Aisha,Pyt... |
| mini-project task | A small build step after the exercise | It turns the lesson into part of the Student Marks and Study Tracker | Student Marks and Study Tracker |
Quick exercise
Write a CSV header for subject names and scores.
Mini-project task
Plan a CSV structure with student_name, subject, score.
Reading data conceptually
At beginner level, think of reading a file as loading saved rows into Python so the program can process them.
with open("marks.csv", "r") as file:
content = file.read()
print(content)
Real-life example: A tracker reads marks from a CSV and calculates an average.
Beginner mistake to avoid
Do not jump into complex file parsing before you understand the file structure.
Why this matters: It helps you build the Student Marks and Study Tracker one small idea at a time.
How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.
Key words for this subtopic| Key word | Simple meaning | Why we use it | Tiny example |
|---|
| Reading data conceptually | The main idea in this part of the lesson | It gives you one building block for the final project | with open("marks.csv", "r") as file: content = file... |
| example | A small sample that shows the idea | It helps you see how the concept looks in practice | with open("marks.csv", "r") as file: content = file... |
| mini-project task | A small build step after the exercise | It turns the lesson into part of the Student Marks and Study Tracker | Student Marks and Study Tracker |
Quick exercise
What should the first row of a CSV usually contain?
Mini-project task
Sketch three example rows for your marks CSV.
Saving project output conceptually
Later, your program could save a report so the learner can review progress over time.
report = "Aisha: Developing"
with open("report.txt", "w") as file:
file.write(report)
Real-life example: A tracker saves a summary after each study session.
Beginner mistake to avoid
Opening a file with "w" can overwrite old content. Use it carefully.
Why this matters: It helps you build the Student Marks and Study Tracker one small idea at a time.
How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.
Key words for this subtopic| Key word | Simple meaning | Why we use it | Tiny example |
|---|
| Saving project output conceptually | The main idea in this part of the lesson | It gives you one building block for the final project | report = "Aisha: Developing" with open("report.txt"... |
| example | A small sample that shows the idea | It helps you see how the concept looks in practice | report = "Aisha: Developing" with open("report.txt"... |
| mini-project task | A small build step after the exercise | It turns the lesson into part of the Student Marks and Study Tracker | Student Marks and Study Tracker |
Quick exercise
What sentence would you save in a progress report?
Mini-project task
Write a sample final report line that your tracker could save in the future.
Topic checkpoint
You understand how the project could later use real saved data from files or CSVs.
Final mini project
Student Marks and Study Tracker
By completing the mini-project tasks after each subtopic, you have planned and built the pieces of a beginner Python project.
Project requirements
- Store student name, subject names and scores
- Calculate an average score
- Decide a readiness level
- Print a simple report and suggest one next step
- Optionally plan CSV storage for later
Skills used
Variables, data types, operators, conditions, loops, lists, functions, dictionaries and a simple file/CSV concept.
student = {
"name": "Aisha",
"subjects": ["Maths", "Python", "SQL"],
"scores": [78, 65, 72]
}
def calculate_average(scores):
return sum(scores) / len(scores)
def get_readiness_level(average):
if average >= 80:
return "Strong"
elif average >= 60:
return "Developing"
else:
return "Needs focus"
def get_next_step(level):
if level == "Needs focus":
return "Revise the lowest scoring subject and retake a short quiz."
elif level == "Developing":
return "Practise the lowest scoring subject and complete one mini project."
else:
return "Start building portfolio evidence with a small project."
def print_student_report(student_record):
average = calculate_average(student_record["scores"])
level = get_readiness_level(average)
next_step = get_next_step(level)
print("Student:", student_record["name"])
print("Average score:", round(average, 1), "%")
print("Readiness level:", level)
print("Next step:", next_step)
print()
print("Subject breakdown:")
for index in range(len(student_record["subjects"])):
subject = student_record["subjects"][index]
score = student_record["scores"][index]
print("-", subject + ":", str(score) + "%")
print_student_report(student)
Example output
Student: Aisha
Average score: 71.7 %
Readiness level: Developing
Next step: Practise the lowest scoring subject and complete one mini project.
Final reflection task
- What input does the program use?
- What calculation does it perform?
- What output does it show?
- Which part uses a condition?
- Which part uses a loop?
- How could this become a portfolio project?
Portfolio explanation
Problem: Learners need a simple way to review marks and identify next steps.
Method: Python stores subject scores, calculates an average and assigns a readiness level.
Result: The program prints a clear study report with a practical next step.
Next step
Use Python in your career roadmap
Continue into the Career Path Guide to test skills for your chosen role, or discuss beginner project guidance on LinkedIn.