Computer Programming II – SS2 Digital Technologies Lesson Note (Second Term)
Download this term · ₦1,000Lesson note at a glance
- Subject
- Digital Technologies
- Class
- SS2
- Term
- Second Term
- Topic
- Computer Programming II
- Order
- Topic 2 of 8 this term
- Reading time
- 4 min
Python is a programming language that translates English-like code into instructions the computer can execute. In this lesson, students learn to display text with print(), store data in variables, identify data types, use basic operators and collect user input with input(). The computer only understands 1s and 0s, so Python acts as the translator.
Behavioural objectives
By the end of the lesson, students should be able to:
- Explain why Python is used as a programming language.
- Use the print() function to display text.
- Create variables and give them values.
- Identify the string, integer, float and Boolean data types.
- Use basic operators, and state the difference between = and ==.
- Use the input() function to ask the user for information.
What is a programming language?
In our last lesson, we learned how to plan a program using algorithms and flowcharts. Now it is time to actually “speak” to the computer.
A computer doesn’t understand English directly. It only understands electrical signals, represented as 1s and 0s. So we use a programming language like Python as a translator. You write something that looks like English, and Python converts it into something the computer can execute.
Why Python?
- It is very easy to read.
- It is used by big companies like Google, NASA and Netflix.
- You don’t need to be a maths genius to start.
How do you display output with print()?
The most basic thing a computer can do is talk back to you. In Python, we use the print() command.
Example:
print(“Hello, SS2 Students!”)
Note: Anything inside the quotation marks “” is called a string. It tells the computer: “Just display this text exactly as it is. Don’t try to calculate it.”
What is a variable?
Imagine you are moving house. You put your books in a box and write “BOOKS” on the outside. Later, when you need them, you just look for the box labelled “BOOKS”.
In programming, a variable is a box in the computer’s memory where we store data. We give the box a name so we can find it later.
How to create a variable:
user_name = “Chidi”
age = 16
- user_name is the label on the box.
- “Chidi” is the item inside the box.
What are data types?
Not everything we store is the same. Python needs to know what kind of data is in the box so it knows how to handle it.
| Data type | What it is | Example |
|---|---|---|
| String (str) | Text or characters (always in quotes). | “Lagos”, “Apple123” |
| Integer (int) | Whole numbers (no decimals). | 5, -10, 1000 |
| Float | Decimal numbers. | 15.5, 0.75 |
| Boolean (bool) | True or False values. | True, False |
What are the basic operators?
Computers are basically giant calculators. Python uses symbols to perform maths on our variables:
- + (Addition): 5 + 2 is 7
- – (Subtraction): 5 – 2 is 3
- * (Multiplication): 5 * 2 is 10
- / (Division): 10 / 2 is 5.0
- == (Comparison): Is x equal to y?
Important: In programming, one equals sign (=) is used to assign a value to a box. Two equals signs (==) are used to check if two things are the same.
How do you get input from the user?
A good program is not a one-way street. You want to ask the user for information. We use the input() command.
Example:
name = input(“What is your name? “)
print(“Welcome to the class, ” + name)
Key points to remember
- Python is our translator.
- Variables are boxes that hold information.
- Strings are for text; integers are for numbers.
- print() shows output; input() gets information.
Class lab activity
- Open the Python IDLE (the program where we type code).
- Task 1: Write a program that prints your name and your favourite food.
- Task 2: Create two variables, num1 and num2. Give them values like 10 and 20. Create a third variable called result that adds them together and prints it.
- Task 3 (Challenge): Write a program that asks for a student’s name and their age, then prints: “Hello [Name], you will be [Age + 1] next year!”
Evaluation
- Why do we need a programming language like Python to communicate with a computer?
- What is a variable? Using the box example, explain what the name and the value stand for.
- Name the four data types in the lesson and give one example of each.
- What is the difference between = and == in Python?
- State the job of print() and the job of input().
Assignment
- Write a Python program that stores your name in a variable called user_name and your age in a variable called age. Then print your name.
- Write one example each of a string, an integer, a float and a Boolean value.
This term's Digital Technologies topics
SS2 Second Term · 8 topics
Get Digital Technologies as PDF and Word
Every week of SS2 Digital Technologies, Second Term, formatted and ready to print. Ad-free, and the copy lock comes off.
Get this term Card, bank transfer, USSD or OPay

