How to Use This Page
This page is designed for students who are beginning to learn Python. Each task is divided into small steps. Read the instructions carefully before writing your code.
Step 1: Read
Read the goal of the task and study the example. Do not copy blindly. Try to understand what each line does.
Step 2: Write
Write your own Python code in the answer box. Use the checklist to make sure your code contains all required elements.
Step 3: Check
Click the button to check your answer. If there is a mistake, read the feedback and improve your code.
Step 4: Improve
Correct your code until you get positive feedback. Programming is about testing, fixing and improving.
Python Basics You Need
Printing text
Use print() to show information on the screen.
print("Hello!")
Variables
A variable is like a box with a name. It stores a value.
name = "Julia"
age = 16
Numbers and calculations
You can use Python like a calculator.
a = 10
b = 5
print(a + b)
Conditions
Use if when the program has to make a decision.
score = 70
if score >= 50:
print("Passed")
else:
print("Try again")
Loops
A loop repeats an action many times.
for number in range(1, 6):
print(number)
Lists
A list stores many values in one variable.
fruits = ["apple", "banana", "orange"]
print(fruits[0])
Guided Practice Tasks
Each task has a clear goal, step-by-step instructions, a checklist and a code box.
Task 1: Print Your First Message
BeginnerGoal: Write a program that prints exactly: Hello Python
- Start with the command
print. - Open round brackets:
(and). - Put the text inside quotation marks.
- Make sure the text is exactly Hello Python.
Example structure: print("your text here")
Task 2: Create and Print a Variable
BeginnerGoal: Create a variable called name and print it.
- Create a variable named
name. - Give it a text value, for example your name.
- Use
print(name)to display the value.
- Your code must contain
name =. - Your text value must be inside quotation marks.
- Your code must contain
print(name).
Task 3: Add Two Numbers
BeginnerGoal: Create two number variables and print their sum.
- Create a variable called
aand give it a number. - Create a variable called
band give it another number. - Use
print(a + b)to print the result.
Task 4: Calculate a Rectangle Area
Beginner PlusGoal: Calculate the area of a rectangle using two variables: width and height.
- Create a variable called
width. - Create a variable called
height. - Create a variable called
area. - The area should be
width * height. - Print the area.
Task 5: Use an If Statement
IntermediateGoal: Check if a student passed a test.
- Create a variable called
score. - Use an
ifstatement. - If
scoreis 50 or more, print Passed. - Otherwise, print Try again.
Task 6: Print Numbers with a Loop
IntermediateGoal: Use a loop to print numbers from 1 to 10.
- Start with
for number in range(...):. - Use
range(1, 11)because the last number is not included. - Inside the loop, print the variable
number. - Remember indentation after the colon.
Task 7: Work with a List
IntermediateGoal: Create a list of three school subjects and print the first subject.
- Create a list called
subjects. - Add at least three subjects, for example
"English","Math","Python". - Print the first element using
subjects[0].
Task 8: Loop Through a List
Intermediate PlusGoal: Create a list of names and print every name using a loop.
- Create a list called
students. - Add at least three names to the list.
- Use a
forloop to go through the list. - Print every name inside the loop.
Task 9: Define a Simple Function
Advanced BeginnerGoal: Create a function called greet that prints Hello.
- Start with
def greet():. - Inside the function, write
print("Hello"). - After the function, call it using
greet().
Task 10: Function with a Parameter
Advanced BeginnerGoal: Create a function called greet with one parameter called name. The function should print the name.
- Define a function:
def greet(name):. - Inside the function, print the variable
name. - Call the function with a text value, for example
greet("Anna").
Mini Projects
Mini Project 1: Student Report
ProjectGoal: Write a short program that creates a simple student report.
- Create a variable called
student. - Create a variable called
subject. - Create a variable called
points. - Print the student name.
- Print the subject.
- If points are 50 or more, print Passed.
- Otherwise, print Try again.
Mini Project 2: Shopping List
ProjectGoal: Create a shopping list and print every item.
- Create a list called
shopping. - Add at least three items.
- Use a
forloop. - Print every item from the list.
Part II: Student Python Project
Project title: My Smart Student Assistant
In this project, you will create a simple Python program based on Part I. You will use variables, printing, calculations, if statements, lists, loops and functions.
Project Scenario
You are creating a small assistant for a student. The program should store the student's name, subjects and points. It should print a short report and decide if the student passed or needs more practice.
You will practise
- creating variables,
- using numbers and text,
- working with lists,
- using a for loop,
- using if / else,
- creating a function.
Example final output
Student: Anna
Age: 16
Subjects:
- English
- Math
- Python
Total points: 78
Result: Passed
Project Step 1: Student Information
Project StepGoal: Create basic information about a student.
- Create a variable called
student. - Create a variable called
age. - Print both variables.
Project Step 2: Subject List
Project StepGoal: Create a list of subjects and print every subject.
- Create a list called
subjects. - Add at least three subjects to the list.
- Use a
forloop. - Print every subject.
Project Step 3: Points and Result
Project StepGoal: Check if the student passed.
- Create a variable called
points. - If points are 50 or more, print Passed.
- Otherwise, print Needs more practice.
Project Step 4: Create a Function
Project StepGoal: Create a function that prints a student report.
- Define a function called
student_report. - Inside the function, print the student name.
- Print the points.
- Call the function at the end.
Final Project: My Smart Student Assistant
Final ProjectGoal: Combine everything into one complete Python program.
- Create a variable called
student. - Create a variable called
age. - Create a list called
subjectswith at least three subjects. - Create a variable called
points. - Create a function called
student_report. - Inside the function, print the student name and age.
- Use a loop to print all subjects.
- Use
if / elseto print Passed or Needs more practice. - Call the function at the end.
Extra challenge: Add one more variable called school and print it in the report.
Student Reflection
After finishing the project, answer these questions in English:
- What does your program do?
- Which part was the easiest?
- Which part was the most difficult?
- What would you like to add to your program?
Teacher Notes
Suggested classroom use: Students can work individually or in pairs. Ask them to complete the tasks in order. After each task, they should explain in one sentence what their code does.
Extension idea: Fast students can modify each program, for example by changing variable names, adding more list elements, or creating extra conditions.
Important: This page checks code structure and common beginner mistakes. It does not run real Python code in the browser.