Course Content
Module 2 – Introduction to Python Programming
In this Introduction to Python module, learners explore Python’s clear, readable syntax and powerful features. Beginning with installation and a simple “Hello, World!” script, you will progress through variables, control flow and functions using step-by-step examples. By the end, you will be equipped to write your own Python programmes, automate routine tasks and tap into an extensive library ecosystem for real-world projects.
0/7
Module 3 – Variables, Data Types and Basic Operations
In the Variables, Data Types and Basic Operations in Python module, learners explore how to store and manage data using variables, master fundamental types such as integers, floats, strings and booleans, and perform arithmetic, comparison and logical operations step by step. Clear explanations, real world examples and hands on exercises guide you through writing and debugging code. By the end of this module, you will be ready to build dynamic Python programs and automate everyday tasks.
0/6
Module 4 – Control Flow – Conditions and Loops
Control flow structures determine the order in which your program’s code executes. With conditional statements, you can make decisions and execute certain code blocks only when specific conditions are met. Loops allow you to repeat actions efficiently without writing redundant code. In this module, we will explore fundamental control flow concepts in Python in a step-by-step manner, similar to Microsoft’s learning curriculum. By the end, you’ll understand how to use if, elif, and else statements (including nested conditions) for decision-making, how truthy and falsy values work in Boolean logic, how to construct for loops (using range() and iterating over collections), how to use while loops along with loop control statements (break and continue), and how to leverage list comprehensions and generator expressions for concise looping. Finally, we’ll apply these concepts in a practical exercise to build an interactive decision-making system. Each section below includes explanations, code examples, and mini-exercises to reinforce the concepts, all formatted for clarity and easy follow-along.
0/8
Module 5 – Functions and Code Organisation
Imagine you need to clean up a messy data set or send a personalised email to each customer. Instead of writing the same steps over and over, you can create a function and call it whenever you need. In this lesson on Functions and Code Organisation, you will learn how to define functions, pass and return information, document your work and group related code into modules for easy reuse and maintenance.
0/3
Introduction to Python Programming (Copy 2)

Lesson: Basic Arithmetic Operations in Python

 Lesson Objectives

By the end of this lesson, students will be able to:

  1. Understand what arithmetic operators are in Python.

  2. Use Python to perform addition, subtraction, multiplication, division, modulus, and exponentiation.

  3. Take input from the user and display calculated results.

  4. Practice basic problem-solving with numbers in Python.

 1. Introduction to Arithmetic Operators

Arithmetic operators are symbols used to perform mathematical operations in Python.
Think of them as the same symbols you use in mathematics but now used in coding.

Operator Meaning Example Result
+ Addition 10 + 5 15
- Subtraction 10 - 5 5
* Multiplication 10 * 5 50
/ Division 10 / 5 2.0
% Modulus (Remainder) 10 % 3 1
** Exponentiation 2 ** 3 8

2. Input and Output in Python

  • print(): Displays output on the screen.

  • input(): Waits for the user to type something and returns it as a string.

Example:

name = input("Enter your name: ")
print("Hello", name)

Output:

Enter your name: Python Programming
Hello Python Programming

 3. Example Code for Arithmetic

# Declare variables
x = 10
y = 5

# Perform arithmetic operations
sum_result = x + y
diff_result = x - y
product_result = x * y
division_result = x / y

# Display the results
print("Sum:", sum_result)
print("Difference:", diff_result)
print("Product:", product_result)
print("Division:", division_result)

Expected Output:

Sum: 15
Difference: 5
Product: 50
Division: 2.0

4. Interactive Example with User Input

# Take input from the user
x = int(input("Enter the first number: "))
y = int(input("Enter the second number: "))

# Perform arithmetic
print("Sum:", x + y)
print("Difference:", x - y)
print("Product:", x * y)
print("Division:", x / y)
print("Remainder:", x % y)
print("Power:", x ** y)

 5. Practice Tasks for Students

  1. Write a program to take two numbers from the user and display:

    • Addition

    • Subtraction

    • Multiplication

    • Division

    • Modulus

  2. Ask the user for two numbers and calculate (first number + second number) / 2.

  3. Create a program that calculates the area of a rectangle (Area = length × width).

 6. Common Mistakes & How to Avoid Them

  • Mistake: Forgetting to convert input to integers.
    ✅ Fix: Use int() or float() when reading numbers.

  • Mistake: Dividing by zero.
    ✅ Fix: Always check if the second number is not zero before dividing.