Course Content
Module 1 – Getting Started with Python
introduced the fundamentals of Python, giving beginners a clear understanding of how the language works and how to start writing simple programs. Python was highlighted as a beginner-friendly language with simple syntax, making it easy to read and write code.
0/7
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
Basic Command for Command prompt, PowerShell, Zsh(macOS)
0/1
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
Day 1 Summary
We covered Modules 1, 2 & Module 3 (Lesson 1 & 2)
0/1
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/10
Day 2 Summary
Summary for Day 21 Aug 2025
0/1
Day 3 Summary
Summary of Day 28 Aug 2025
0/1
Module 7 – Working with Files and Folders
In this lesson, we will learn how to manipulate files and directories using Python. We’ll explore common file operations using the os module, and see how the pathlib module provides an object-oriented way to handle file paths. We’ll also use the glob module for pattern-based file searches and learn file I/O operations for text, CSV, and binary files. Additionally, we’ll introduce the calendar and time modules to work with dates and timestamps. Finally, an interactive lab will tie everything together by automating a folder backup and cleanup task. Follow the step-by-step sections below for each subtopic, try out the code examples, and explore the guided lab at the end.
0/9
Module 8 – Error Handling and Debugging Techniques
In this lesson, we will learn how to handle errors in Python programs and how to debug code effectively. Errors are inevitable, but knowing how to manage them ensures our programs don't crash unexpectedly. We will cover the difference between syntax errors and exceptions, how to use try, except, else, and finally blocks to catch and handle exceptions, and how to raise your own exceptions (including creating custom exception classes). We’ll also explore debugging strategies: using simple print statements or the logging module to trace your program’s execution, and using Python’s interactive debugger pdb to step through code. By following best practices for error handling and debugging, you can write resilient, maintainable code. Throughout this lesson, try the examples and exercises to practice these techniques.
0/9
Day 4 Summary
0/1
Module 9 – Automating Excel and PDFs with Python
In this lesson, you will learn how to automate common communication and reporting tasks using Python. We will cover sending notifications via email, messaging platforms, and SMS, as well as manipulating Excel spreadsheets and PDF files programmatically. Each section below includes step-by-step explanations, code examples, and interactive exercises to reinforce your understanding. By the end of this lesson, you’ll be able to send emails with attachments, integrate with Slack/Microsoft Teams, send SMS alerts, and automate Excel/PDF workflows.
0/9
Day 5 Summary
0/1
Mini Project: Build your own Automation Tool
The project incorporates two common automation tasks – Contact Management and Student Tasks Tracking
0/2
Day 6 Summary
0/1
Introduction to Python Programming (Copy 1)

Organizing code into modules and packages

As your Python program grows, it’s helpful to organize code into multiple files and directories. Python supports this through modules and packages. This modular organization makes code more maintainable and reusable.

Modules: A module is simply a file containing Python code (definitions and statements). The module’s name is the file name without the .py extension. For example, if you have a file helpers.py with some function definitions, that file is a module named helpers. Modules allow you to logically separate code (for instance, grouping related functions together) and reuse code across multiple programs by importing the module.

Why use modules? If you write a longer program, you may want to split it into multiple files for easier maintenance, or reuse a function in several programs without copy-pasting it into each. Python lets you import definitions from one module into another. When you import a module, you can then access its functions, classes, and variables using the module’s name as a prefix (or import specific names directly). For example, if helpers.py defines a function compute(), you can use it in another script by writing import helpers and then calling helpers.compute().

Creating a Module: To create a module, all you need to do is write a Python .py file. For instance, let’s create a simple module file named mymath.py:

# contents of mymath.py
PI = 3.14159

def circle_area(radius):
    return PI * radius * radius

def square_area(side):
    return side * side

We save this file in the same directory as our main program. Now we can use this module in another script:

import mymath

print("Pi is:", mymath.PI)
print("Circle area:", mymath.circle_area(5))
print("Square area:", mymath.square_area(5))

When we run the main program, Python will load mymath.py (execute it) and make its functions and variables available through the mymath namespace. The output might be:

Pi is: 3.14159
Circle area: 78.53975
Square area: 25

You can also use from mymath import circle_area to import a specific function directly, or even from mymath import * to import everything (though the latter is usually discouraged as it can clutter your namespace).

Note: The first time a module is imported in a session, Python executes the code in that module (initializing variables, defining functions, etc.). Subsequent imports of the same module reuse the already-loaded module (unless you explicitly reload it).

Packages: A package is a way of organizing related modules into a directory hierarchy. A package is essentially a folder that contains multiple module files. What signals to Python that a folder is a package is the presence of an __init__.py file in that folder. (In modern Python, an __init__.py can be empty; its mere presence makes the directory a package. Without it, Python won’t recognize the directory as a package for import purposes.)

Think of a package as a collection of modules under a common namespace. For example, you might have a package shapes which contains modules circle.py, square.py, triangle.py, etc. To create this package:

  1. Create a directory named shapes.

  2. Inside shapes, create an empty file __init__.py (this can be empty or can execute package initialization code).

  3. Create your module files circle.py, square.py, etc., inside the shapes directory.

The directory structure might look like:

shapes/              <-- package directory
    __init__.py      <-- special file to mark a package
    circle.py        <-- module for circle-related functions
    square.py        <-- module for square-related functions
    triangle.py      <-- module for triangle-related functions

Now, if this shapes directory is in your Python module search path (for instance, in the same directory as your main script), you can import from the package. For example:

import shapes.circle
from shapes import square

area = shapes.circle.area(5)   # call function area() from circle module
side = 4
print("Square area:", square.area(side))

Here, shapes.circle refers to the circle.py module within the shapes package. We could also do from shapes.circle import area to import a specific function from that module. The package provides a hierarchical namespace (shapes -> circle) to organize modules.

The __init__.py in a package can also execute code. Often it’s left empty, but you can use it to set up package-level variables, or to import certain submodules for easier access. For instance, you might have __init__.py do from .circle import area as circle_area so that a user can do from shapes import circle_area directly. The . in import means relative import within the package (e.g., from . import circle within shapes/__init__.py would import the circle module from the same package).

Using Modules and Packages: When you use imports, keep in mind:

  • Use import module_name to import an entire module. Then you refer to its contents with module_name.x syntax.

  • Use from module_name import name1, name2 to import specific things directly.

  • Use import package.module to import a submodule from a package.

  • You can use as to give an alias to a module: e.g., import numpy as np (common in data science) or in our example, import shapes.circle as circle_mod.

  • A module is loaded only once per interpreter session. If you edit the module file and want to see changes without restarting Python, you need to reload it (using importlib.reload, for advanced use).

Example Package Usage: Suppose our shapes package’s circle.py defines area(radius) and circumference(radius), and square.py defines area(side) and so on. We could use them as:

from shapes.circle import area as circle_area
from shapes.square import area as square_area

print(circle_area(3))  # uses shapes/circle.py's area
print(square_area(3))  # uses shapes/square.py's area

This is straightforward and prevents name collisions by specifying which module’s function we want (we aliased them to avoid both being called just area in our code).

When to create a package? If you have just a few modules, a package might not be necessary. But if you have many modules that logically belong together (like a toolkit of related utilities), grouping them in a package helps avoid name conflicts with other modules and clarifies their relationship.

Summary: Organising code into modules and packages is key for larger programs:

  • A module is a single Python file that can be imported. It allows code reuse across scripts.

  • A package is a directory of modules (and possibly subpackages) with an__init__.py, providing a nested namespace for organization.

Use modules and packages to structure code by functionality (e.g., one module for database logic, another for computations, etc.), making it easier to maintain and navigate. Python’s standard library itself is a collection of many modules and packages.

By splitting your code into modules, you also enable easier testing (you can test each module’s functionality in isolation) and easier collaboration (different team members can work on different modules without stepping on each other’s toes). Remember to document your modules and packages (via docstrings and README files) so users know how to use them.