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: Working with Strings in Python

1. Creating Strings

In Python, text is called a string, and its data type is str.

You can create strings by enclosing text in either single (‘ ‘) or double (” “) quotes:

greeting = 'Hello'
place = "World"
message = greeting + ' ' + place   # Output: "Hello World"

 You can combine (concatenate) strings using the + operator.

2. Handling Quotes and Special Characters

Sometimes, your string needs to contain quotes or backslashes. Python gives you three ways to handle this:

Use Opposite Quote Types:

text = "She said, 'G'day!'"

Escape Quotes with a Backslash :

text = 'She said, 'G'day!''

Use Raw Strings to Keep Backslashes Literal:

path = r'C:UsersFatimaDocuments'

3. Printing Text

Use print() to show strings on the screen.

s = 'Line one.nLine two.'
print(s)

Output:

Line one.
Line two.

n means a newline character. Python interprets it automatically.

4. Accessing Parts of Strings

Strings in Python are sequences — you can access characters by their index.

Indexing (Zero-Based)

word = 'Python'
print(word[0])    # 'P'
print(word[-1])   # 'n' (last character)

Slicing (start:stop)

word = 'Python'

part = word[1:4]        # 'yth' (index 1 to 3)
start_to_mid = word[:2] # 'Py' (start to index 1)
mid_to_end = word[4:]   # 'on' (index 4 to end)

 Python slices always include the start index and exclude the stop index.

Quick Tips

Concept Example Output
Concatenation 'Hello' + ' World' 'Hello World'
Escape characters 'I'm happy' "I'm happy"
Newline 'Line1nLine2'

Two Lines

Indexing 'Python'[0] 'P'
Slicing 'Python'[1:4] 'yth'