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)

Reading and Validating Input Data

With a plan in hand, we can consider the inputs our script needs. Input data can come from various sources depending on the task:

  • User input (e.g., a filename or an option entered via keyboard)

  • Files on disk

  • Other systems (like a database or an API)

For our purposes, we’ll focus on reading input either from a user or from files, since our example deals with files.

Reading input means obtaining the necessary data for your script to work on.
In our file-organizing pseudocode, the input is implicitly the list of files in the downloads folder. In other cases, the script might prompt the user for information.

For example, a bulk rename script might ask:

  • “Please enter the directory path:”

  • “Enter the prefix for new filenames:”

These are user inputs that the program needs in order to proceed.

Validating Input

Once input is read, it’s critical to validate it. Input validation is the process of checking that the data provided is sensible, correct, and usable before the main processing happens. This prevents errors or unintended behavior later in the program.

Never trust input blindly – always check it meets your assumptions.

Common Validation Steps

  • Type and Format Check:
    Ensure the input is of the expected type or format.
    E.g., if you expect a number, verify the input is numeric.
    If it’s a file path, ensure it’s a valid path string.

  • Presence / Non-empty:
    Check that required inputs are not empty or null.
    E.g., an empty string where a file name is expected should trigger a prompt again or an error.

  • Range or Set Check:
    If only certain values are acceptable, verify the input is one of those.
    E.g., if the script asks “Type 1 to rename files or 2 to categorize files”, and the user enters 5 — that’s invalid.

  • Existence:
    For file paths or URLs, check that they actually exist or are reachable.
    E.g., if a user provides a directory path, the script should verify that directory exists on disk before proceeding.

How to Validate?

The typical pattern is to use a conditional check and possibly a loop to re-prompt until valid.

Example Pseudocode (Validating a Number Input):

REPEAT
    PROMPT "Enter a number from 1 to 10:"
    RECEIVE userInput
    IF userInput < 1 OR userInput > 10 THEN
        PRINT "Invalid input, please try again."
END REPEAT UNTIL userInput >= 1 AND userInput <= 10

This logic keeps asking the user until they enter a valid number within the specified range.

File-Based Input Validation

If the script processes a file (e.g., a CSV), you might:

  • Check that the file can be opened (exists and not locked).

  • Check that the first line has expected headers, or each line has the correct number of columns.

Example Use Case: Organizing Files

Inputs and Validations to Consider:

  • Directory Path (folder_path):
    If this is user-supplied, verify the path is valid and accessible.
    Our pseudocode used a fixed “Downloads” path, but a more general script might take this as input.
    If invalid, either prompt again or exit with an error message.

  • File Types Dictionary:
    If user-configurable (e.g., user defines which extensions go to which folder), validate:

    • That extensions are correctly formatted (like “.txt”).

    • That target folders exist — or create them if they don’t.

  • User Confirmation (Optional):
    Show the user what the script will do — especially for destructive actions.
    Validate that the user enters “yes”, “no”, “y”, or “n”, and re-prompt if necessary.

Handling Invalid Input

If validation fails, your script should respond gracefully. Options include:

  • Re-prompting the user (e.g., in a loop)

  • Substituting a safe default value (e.g., use file_ if no prefix is given)

  • Exiting with a clear error message (if the input is essential and invalid)

The approach depends on the context:

  • For interactive CLI tools, re-prompting is user-friendly.

  • For automated scripts, you might prefer logging the error and exiting.

Example (User Input Path Validation)

Pseudocode:

PROMPT "Enter the path of the folder to organize:"
RECEIVE folder_path

IF folder_path is not a valid directory:
    PRINT "Error: The folder path does not exist. Exiting."
    END program.

Alternatively, wrap this in a loop to allow retries in case of typos.

Exercise

Think about your task’s inputs:

  • What information does your script need to start working?

  • List the inputs.

  • For each, consider what would make it “invalid.”

Write a short pseudo-check for at least one of them.
Example:

IF file not found OR file extension is not .txt THEN
    show error and ask for a correct file.

Doing this will help ensure your script is robust and user-friendly when you implement it.