0% found this document useful (0 votes)
105 views105 pages

Introduction to Python Programming

This document serves as an introduction to Python programming, covering its features, installation, variables, data types, and basic operations. It highlights Python's ease of learning, versatility, and strong community support, while also detailing built-in data structures like lists, tuples, and dictionaries. Additionally, it includes practical coding challenges to reinforce learning and encourages users to explore Python's capabilities.

Uploaded by

MULUSEW DESALE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
105 views105 pages

Introduction to Python Programming

This document serves as an introduction to Python programming, covering its features, installation, variables, data types, and basic operations. It highlights Python's ease of learning, versatility, and strong community support, while also detailing built-in data structures like lists, tuples, and dictionaries. Additionally, it includes practical coding challenges to reinforce learning and encourages users to explore Python's capabilities.

Uploaded by

MULUSEW DESALE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

WEEK-1 Introduction to Python

Python is not just a language, it’s a superpower

In this course, you’ll go from writing your first line of code to building cool projects that’ll make you say,
‘Wow, I did that! 😎’

Whether you’re totally new to coding or just looking to sharpen your Python skills, get ready for an epic
journey filled with coding magic, challenges, and lots of fun moments.

Python Language Quick Overview


Python is a high-level, interpreted programming language that is widely used for many different purposes, from
web development to scientific computing to machine learning.

There are several reasons why Python is a great choice for many different types of projects:

1. Easy to learn: Python has a relatively simple syntax, which makes it easier for beginners to learn
compared to other programming languages.
2. Versatile: Python can be used for a wide range of applications, including web development, data
analysis, artificial intelligence, and more.
3. Large and active community: There is a large and active community of Python developers, which
means that there are many resources available for learning and solving problems.
4. Plenty of libraries: Python has a large number of libraries, including NumPy, pandas, and Matplotlib,
which can be used to perform complex tasks with just a few lines of code.
5. Cross-platform compatibility: Python can run on multiple operating systems, including Windows,
macOS, and Linux, making it a good choice for projects that need to be run on multiple platforms.

Install Python3 and Vs-Code on a Windows machine


[Link]

Install Python
If you don't want to use Thonny, here's how to install and run Python on your computer.

1. Download the latest version of Python.


2. Run the installer file and follow the steps to install Python
3. During the installation process, check Add Python to environment variables. This will add Python to
environment variables, and you can run Python from any part of the computer.
4. Also, you can choose the path where Python is installed.
Note: For Unix based Operating Systems like Linux and macOS systems have Python pre-installed

All About Python Variables 🧠💡


[Link]

In programming, a variable is a container (storage area) to hold data. For example,

number = 10

Here, the number is the variable storing the value 10.

Assigning values to Variables in Python


As we can see from the above example, we use the assignment operator = to assign a value to a variable.

site_name = "Power Learn Project"


print(site_name)

In the above example, we assigned the value ‘Power Learn Project’ to the site_name variable. Then, we
printed out the value assigned to site_name.

Note: Python is a type-inferred language, so you don't have to explicitly define the variable type. It
automatically knows that Power Learn Projects is a string and declares the site_name variable as a string.

Changing the Value of a Variable in Python


site_name = "Power Learn Project"
print(site_name)

# Assigning new value to site_name


site_name = "I love coding 😊"
print(site_name)

# The output will be


Power Learn Project
I love coding 😊

Here, the value of site_name is changed from ‘Power Learn Project’ to 'I love coding 😊'.

Example: Assigning multiple values to multiple variables


a, b,c = 5, 7, "Hello world"

print(a) # prints 5
print(b) # prints 5
print(c) # prints Hello World

Rules for Naming Python Variables


 Constant and variable names should have a combination of letters in lowercase (a to z) or uppercase (A
to Z) or digits (0 to 9) or an underscore (_). For example:

 snake_case
 MACRO_CASE
 camelCase
 CapsWords

 Python is case-sensitive. So num and Num are different variables. For example,

num = 55
Num = 510
print(num) #5
print(Num) #510

 Avoid using keywords like if, True, class, etc. as variable names.

More Resources:

1. [Link]
2. [Link]
3. [Link]
4. [Link]
Understanding Python Datatypes
[Link]

In computer programming, data types specify the type of data that can be stored inside a variable. For example,

num = 24

Here, 24 (an integer) is assigned to the num variable. So the data type of num is of the int class.

Python Data Types


Data Types Class Description

numeric int, float, complex Holds numeric values


string str Holds sequence of characters
sequence list, tuple ,range Holds collection of items
mapping dict Holds data in key-value pair form
boolean bool Holds either True or False
set set Holds collection of unique items

Since everything is an object in Python programming, data types are actually classes and variables are
instances(object) of these classes.

Python Numeric Data type


In Python, the numeric data type is used to hold numeric values.

Integers, floating-point numbers and complex numbers fall under Python numbers category. They are defined as
int, float and complex classes in Python.

 int - holds signed integers of non-limited length.


 float - holds floating decimal points and it's accurate up to 15 decimal places.

We can use the type() function to know which class a variable or a value belongs to.

Let's see an example,

num1 = 55
num2 = 5.3
print(num1)
print(num2)

Python List Data Type


A list is an ordered collection of similar or different types of items separated by commas and enclosed within
brackets [ ]. For example,

languages = ["Python", "Dart", "Web", 23]


print(languages)

Here, we have created a list named languages with 3 string values inside it.

Access List Items


To access items from a list, we use the index number (0, 1, 2 ...). For example,

languages = ["Python", "Dart", "Web", 23]


print(languages[1])

In the above example, we have used the index values to access items from the languages list.

 languages[0] - access the first item from languages i.e. Python


 languages[2] - access the third item from languages i.e. Web

Python Tuple Data Type


A tuple is an ordered sequence of items same as a list. The only difference is that tuples are immutable. Tuples
once created cannot be modified.

In Python, we use the parentheses () to store items of a tuple. For example,

products = ('XBox', 499.99, "Habibi", 23)


print(products)

Here, product is a tuple with a string value Xbox and integer value 499.99.

Access Tuple Items


Similar to lists, we use the index number to access tuple items in Python. For example,

products = ('XBox', 499.99, "Habibi", 23)


print(products[2])

Python String Data Type


String is a sequence of characters represented by either single or double quotes. For example,

site_name = "Power Learn Project"


print(site_name)

In the above example, we have created string-type variables: name and message with values 'Python' and
'Python for beginners' respectively.

Python Set Data Type


The Set is an unordered collection of unique items. Set is defined by values separated by commas inside braces
{ }. For example,

student_ids = {112, 114, 117, 113}


print(student_ids)

Here, we have created a set named student_info with 5 integer values.

Since sets are unordered collections, indexing has no meaning. Hence, the slicing operator [] does not work.

Python Dictionary Data Type


Python dictionary is an ordered collection of items. It stores elements in key/value pairs.

Here, keys are unique identifiers that are associated with each value.

Let's see an example,

capital_city = {"Kenya": "Nairobi", "Nigeria": "Lagos"}


print(capital_city)

More Resources:

1. [Link]
2. [Link]
3. [Link]
4. [Link]

Python Basic Operations


Operators are special symbols that perform operations on variables and values. For example,

[Link]

Types of Python Operators


Here's a list of different types of Python operators that we will learn in this tutorial.

1. Arithmetic operators
2. Assignment Operators
3. Comparison Operators
4. Logical Operators
5. Bitwise Operators
6. Special Operators

1. Python Arithmetic Operators

Arithmetic operators are used to perform mathematical operations like addition, subtraction, multiplication, etc.
For example,
sub = 10 - 5 # 5

Here, - is an arithmetic operator that subtracts two values or variables.

operator operation Example

+ addition 5 + 2 = 7

- subtraction 4 - 2 = 2

* multiplication 2 * 3 = 6

** exponentiation ( power) 4 ** 2 = 16

/ float division 4 / 2 = 2

// floor division 10 // 3 = 3

% modulus (remainder) 5 % 2 = 1

In the above example, we have used multiple arithmetic operators,

 + to add a and b
 - to subtract b from a
 * to multiply a and b
 / to divide a by b
 // to floor divide a by b
 % to get the remainder
 ** to get a to the power b

2. Python Assignment Operators

Here's a list of different assignment operators available in Python.

Operator Example Same As

= x=5 x=5

+= x += 3 x=x+3

-= x -= 3 x=x–3

*= x *= 3 x=x*3

/= x /= 3 x=x/3

%= x %= 3 x=x%3

//= x //= 3 x = x // 3

**= x **= 3 x = x ** 3

&= x &= 3 x=x&3


|= x |= 3 x=x|3

^= x ^= 3 x=x^3

>>= x >>= 3 x = x >> 3

<<= x <<= 3 x = x << 3

x=3
:= print(x := 3)
print(x)

Here, we have used the += operator to assign the sum of a and b to a.

Similarly, we can use any other assignment operators according to the need.

3. Python Comparison Operators

Comparison operators compare two values/variables and return a boolean result: True or False. For example

Here, the > comparison operator is used to compare whether a is greater than b or not.

Operator Name Example

== Equal 2 == 2

!= Not equal 4 != 2

> Greater than 5>3

< Less than 2<7

>= Greater than or equal to x >= y

<= Less than or equal to x <= y

Note: Comparison operators are used in decision-making and loops. We'll discuss more of the comparison
operator and decision-making in later tutorials.

4. Python Logical Operators

Logical operators are used to check whether an expression is True or False. They are used in decision-making.
For example,

Operator Description Example

and Returns True if both statements are true x < 5 and x < 10
or Returns True if one of the statements is true x < 5 or x < 4

not Reverse the result, returns False if the result is true not(x < 5 and x < 10)

More Resources:

1. [Link]
2. [Link]
3. [Link]

Weekly Code Challenge

Here are some fun and beginner-friendly project ideas you can try at this stage:

1. Personalized Greeting App 👋

 Create a program that asks for the user’s name and favorite color, then prints a personalized greeting
like: “Hello, [Name]! Your favorite color, [Color], is awesome!”

2. Simple Quiz Game 🎮

 Create a multiple-choice quiz with questions about Python, movies, or any fun topic! Display scores at the end
and allow the user to play again. 🏆

3. Random Joke Generator 🧠

 Build a program that stores a list of jokes and randomly selects one to display every time the user runs it. Add a
fun twist with jokes about Python or programming! 🐍💡

July 2025 Cohort


Introduction to Python Recording

(Right-click on the Link to Open in a New Tab)

Session 1

Session 2

Session 3
WEEK-2 Python Built in Data Structures
So far, you have only stored small bits of data in a variable. This was either an integer, Boolean or a string.

But what happens if you need to work with more complex information, such as a collection of data like a list of
people or a list of companies? Data structures are designed for this very purpose.

A data structure allows you to organize and arrange your data to perform operations on them. Python has the
following built-in data structures: List, dictionary, tuple and set. These are all considered non-primitive data
structures, meaning they are classed as objects, we will explore this more.

Along with the built-in data structures, Python allows users to create their own. Data structures such as Stacks,
Queues and Trees can all be created by the user.

Each data structure can be designed to solve a particular problem or optimize a current solution to make it much
more performant.

Mutability and Immutability


Data Structures can be mutable or immutable.

Mutability refers to data inside the data structure that can be modified. For example, you can either change,
update, or delete the data when needed. A list is an example of a mutable data structure.

An immutable data structure will not allow modification once the data has been set. The tuple is an example of
an immutable data structure.

Lists & Tuples

n Python, lists are used to store multiple data at once. For example,
Suppose we need to record the ages of 5 students. Instead of creating 5 separate variables, we can simply create
a list:

Lists Elements

Create a Python List


[Link]

A list is created in Python by placing items inside [], separated by commas. For example,

Here, we have created a list named numbers with 3 integer items.

A list can have any number of items and they may be of different types (integer, float, string, etc.). For example,
Access Python List Elements
In Python, each item in a list is associated with a number. The number is known as a list index.

We can access elements of an array using the index number (0, 1, 2 …). For example,

In the above example, we have created a list named languages.

List Indexing in Python


Here, we can see each list item is associated with the index number. And, we have used the index number to
access the items.

Note: The list index always starts with 0. Hence, the first element of a list is present at index 0, not 1.

Slicing of a Python List


In Python, it is possible to access a section of items from the list using the slicing operator:, not just a single
item. For example,

Here,

 my_list[2:5] returns a list with items from index 2 to index 4.


 my_list[5:] returns a list with items from index 1 to the end.
 my_list[:] returns all list items

Note: When we slice lists, the start index is inclusive but the end index is exclusive.

Add Elements to a Python List

Python List provides different methods to add items to a list.

1. Using append()
The append() method adds an item at the end of the list.

For example,

Here, append() adds 32 at the end of the array.

2. Using extend()

We use the extend() method to add all items of one list to another. For example,
In the above example, we have two lists named prime_numbers and even_numbers. Notice the statement,

Change List Items


Python lists are mutable. Meaning lists are changeable. And, we can change items of a list by assigning new
values using = operator. For example,

Remove an Item From a List


1. Using del()

In Python, we can use the del statement to remove one or more items from a list. For example,
2. Using remove()

We can also use the remove() method to delete a list item.

For example:

Here, [Link]('Python') removes 'Python' from the languages list.

Python List Methods


Python has many useful list methods that make it really easy to work with lists.
Iterating through a List
We can use the for loop to iterate over the elements of a list. For example,
Python List Comprehension
List comprehension is a concise and elegant way to create lists.

A list comprehension consists of an expression followed by the for statement inside square brackets.

Here is an example to make a list with each item being increasing by power of 2.

In the above example, we have used the list comprehension to make a list with each item being increased by
power of 2. Notice the code,

Tuples
A tuple in Python is similar to a list. The difference between the two is that we cannot change the elements of a
tuple once it is assigned whereas we can change the elements of a list.

Creating a Tuple
[Link]
A tuple is created by placing all the items (elements) inside parentheses (), separated by commas. The
parentheses are optional, however, it is a good practice to use them.

A tuple can have any number of items and they may be of different types (integer, float, list, string, etc.).

Create a Python Tuple with one Element


In Python, creating a tuple with one element is a bit tricky. Having one element within parentheses is not
enough.

We can use the type() function to know which class a variable or a value belongs to.

Here,

 ("hello") is a string so type() returns str as class of var1 i.e. <class 'str'>
 ("hello",) and "hello", both are tuples so type() returns tuple as class of var1 i.e. <class 'tuple'>

Access Python Tuple Elements


Like a list, each element of a tuple is represented by index numbers (0, 1, ...) where the first element is at index
0.

We use the index number to access tuple elements. For example,


1. Indexing

We can use the index operator [] to access an item in a tuple, where the index starts from 0.

So, a tuple having 6 elements will have indices from 0 to 5. Trying to access an index outside of the tuple index
range( 6,7,... in this example) will raise an IndexError.

The index must be an integer, so we cannot use float or other types. This will result in TypeError.

Likewise, nested tuples are accessed using nested indexing, as shown in the example below.

In the above example,

 letters[0] - accesses the first element


 letters[5] - accesses the sixth element

2. Negative Indexing

Python allows negative indexing for its sequences.

The index of -1 refers to the last item, -2 to the second last item and so on. For example,
In the above example,

 letters[-1] - access last element


 letters[-3] - access third last element

Python Tuple Methods


In Python, methods that add items or remove items are not available with tuples. Only the following two
methods are available.

Some examples of Python tuple methods:

Here,

 my_tuple.count('p') - counts total number of 'p' in my_tuple


 my_tuple.index('l') - returns the first occurrence of 'l' in my_tuple
More Resources:

1. [Link]
2. [Link]
3. [Link]
4. [Link]

Dictionaries
Python dictionary is an ordered collection (starting from Python 3.7) of items. It stores elements in key/value
pairs. Here, keys are unique identifiers that are associated with each value.

[Link]

Let's see an example,

If we want to store information about countries and their capitals, we can create a dictionary with country
names as keys and capitals as values.

Create a dictionary in Python


Here's how we can create a dictionary in Python.
In the above example, we have created a dictionary named capital city. Here,

1. Keys are "Nepal", "Italy", "England"


2. Values are "Kathmandu", "Rome", "London"

Note: Here, keys and values both are of string type. We can also have keys and values of different data types.

Example 1: Python Dictionary

In the above example, we have created a dictionary named numbers. Here, keys are of integer type and values
are of string type.

Add Elements to a Python Dictionary


We can add elements to a dictionary using the name of the dictionary with [].

For example,
In the above example, we have created a dictionary named capital_city. Notice the line,

Here, we have added a new element to capital_city with key: Japan and value: Tokyo.

Change Value of Dictionary


We can also use [] to change the value associated with a particular key. For example,
In the above example, we have created a dictionary named student_id. Initially, the value associated with the
key 112 is "Kyle". Now, notice the line,

Here, we have changed the value associated with the key 112 to "Stan".

Accessing Elements from Dictionary


In Python, we use the keys to access their corresponding values. For example,
Here, we have used the keys to access their corresponding values.

If we try to access the value of a key that doesn't exist, we'll get an error.

For example,

Removing elements from Dictionary


We use the del statement to remove an element from the dictionary. For example,
Here, we have created a dictionary named student_id. Notice the code,

The del statement removes the element associated with the key 111. We can also delete the whole dictionary
using the del statement,

We are getting an error message because we have deleted the student_id dictionary and student_id doesn't exist
anymore.

Python Dictionary Methods


Methods that are available with a dictionary are tabulated below. Some of them have already been used in the
above examples.

Dictionary Membership Test


We can test if a key is in a dictionary or not using the keyword in. Notice that the membership test is only for
the keys and not for the values.

Iterating Through a Dictionary


We can iterate through each key in a dictionary using a loop.
Here, we have iterated through each key in the squares dictionary using the for loop.

More Resources:

1. [Link]
2. [Link]

Set
A set is a collection of unique data. That is, elements of a set cannot be duplicated.

For example,

Suppose we want to store information about student IDs. Since student IDs cannot be duplicated, we can use a
set.

Python Set Elements

Create a Set in Python


[Link]

In Python, we create sets by placing all the elements inside curly braces {}, separated by comma.
A set can have any number of items and they may be of different types (integer, float, tuple, string etc.). But a
set cannot have mutable elements like lists, sets or dictionaries as its elements.

Let's see an example,

In the above example, we have created different types of sets by placing all the elements inside the curly braces
{}.

Note: When you run this code, you might get output in a different order. This is because the set has no
particular order.

Create an Empty Set in Python


Creating an empty set is a bit tricky. Empty curly braces {} will make an empty dictionary in Python.

To make a set without any elements, we use the set() function without any argument.

For example,
Here,

 empty_set - an empty set created using set()


 empty_dictionary - an empty dictionary created using {}

Finally we have used the type() function to know which class empty_set and empty_dictionary belong to.

Duplicate Items in a Set


Let's see what will happen if we try to include duplicate items in a set.

Here, we can see there are no duplicate items in the set as a set cannot contain duplicates.

Add and Update Set Items in Python


Sets are mutable. However, since they are unordered, indexing has no meaning. We cannot access or change an
element of a set using indexing or slicing. Set data type does not support it. Add Items to a Set in Python

In Python, we use the add() method to add an item to a set. For example,

In the above example, we have created a set named numbers. Notice the line,

Here, add() adds 32 to our set.

Update Python Set

The update() method is used to update the set with items other collection types (lists, tuples, sets, etc).

For example,
Here, all the unique elements of tech_companies are added to the company's set.

Remove an Element from a Set


We use the discard() method to remove the specified element from a set.

For example,

Here, we have used the discard() method to remove 'Java' from the languages set.
Built-in Functions with Set
Built-in functions like all(), any(), enumerate(), len(), max(), min(), sorted(), sum() etc. are commonly used with
sets to perform different tasks.

Iterate Over a Set in Python

Find Number of Set Elements


We can use the len() method to find the number of elements present in a Set.

For example,

Here, we have used the len() method to find the number of elements present in a Set.

Python Set Operations


Python Set provides different built-in methods to perform mathematical set operations like union, intersection,
subtraction, and symmetric difference.

Union of Two Sets


The union of two sets A and B include all the elements of set A and B.

Set Union in Python

We use the | operator or the union() method to perform the set union operation.

For example,

Note: A|B and union() is equivalent to A ⋃ B set operation.

Set Intersection
The intersection of two sets A and B include the common elements between set A and B.
Set Intersection in Python

In Python, we use the & operator or the intersection() method to perform the set intersection operation.

For example,

Note: A&B and intersection() is equivalent to A ⋂ B set operation.

Difference between Two Sets


The difference between two sets A and B include elements of set A that are not present on set B.
Set Difference in Python

We use the - operator or the difference() method to perform the difference between two sets.

For example,

Note: A - B and [Link](B) is equivalent to A - B set operation.

Set Symmetric Difference


The symmetric difference between two sets A and B includes all elements of A and B without the common
elements.
Set Symmetric Difference in Python

In Python, we use the ^ operator or the symmetric_difference() method to perform symmetric difference
between two sets.

For example,
Check if two sets are equal
We can use the == operator to check whether two sets are equal or not.

For example,

In the above example, A and B have the same elements, so the condition

evaluates to True. Hence, the statement print('Set A and Set B are equal') inside the if is executed.

Other Python Set Methods


There are many set methods, some of which we have already used above. Here is a list of all the methods that
are available with the set objects:

More Resources:

1. [Link]
2. [Link]
Python String & String Methods
In computer programming, a string is a sequence of characters.

For example, "hello" is a string containing a sequence of characters 'h', 'e', 'l', 'l', and 'o'.

[Link]

We use single quotes or double quotes to represent a string in Python.

For example,

Here, we have created a string variable named string1. The variable is initialized with the string Python
Programming.

Example: Python String

In the above example, we have created string-type variables: name and message with values "Python" and "I
love Python" respectively.

Here, we have used double quotes to represent strings but we can use single quotes too.
Access String Characters in Python
We can access the characters in a string in three ways.

 Indexing: One way is to treat strings as a list and use index values.

For example,

 Negative Indexing: Similar to a list, Python allows negative indexing for its strings.

For example,

 Slicing: Access a range of characters in a string by using the slicing operator colon :

For example,

Note: If we try to access an index out of the range or use numbers other than an integer, we will get errors.

Python Strings are immutable


In Python, strings are immutable. That means the characters of a string cannot be changed.

For example,
However, we can assign the variable name to a new string.

For example,

Python Multiline String


We can also create a multiline string in Python. For this, we use triple double quotes """ or triple single quotes
'''.

For example,
In the above example, anything inside the enclosing triple quotes is one multiline string.

Python String Operations


There are many operations that can be performed with strings which makes it one of the most used data types in
Python.

1. Compare Two Strings

We use the == operator to compare two strings. If two strings are equal, the operator returns True. Otherwise, it
returns False.

For example,

In the above example,

 str1 and str2 are not equal. Hence, the result is False.
 str1 and str3 are equal. Hence, the result is True.

2. Join Two or More Strings

In Python, we can join (concatenate) two or more strings using the + operator.
In the above example, we have used the + operator to join two strings: greet and name.

Iterate Through a Python String


We can iterate through a string using a for loop.

For example,

Python String Length


In Python, we use the len() method to find the length of a string.

For example,
String Membership Test
We can test if a substring exists within a string or not, using the keyword in.

Methods of Python String


Besides those mentioned above, there are various string methods present in Python. Here are some of those
methods:

Escape Sequences in Python


The escape sequence is used to escape some of the characters present inside a string.

Suppose we need to include both double quote and single quote inside a string,

Since strings are represented by single or double quotes, the compiler will treat "He said, " as the string. Hence,
the above code will cause an error.

To solve this issue, we use the escape character \ in Python.

Here is a list of all the escape sequences supported by Python.


Python String Formatting (f-Strings)
Python f-Strings make it really easy to print values and variables.

For example,
Here, f'{name} is from {country}' is an f-string.

1. This new formatting syntax is powerful and easy to use. From now on, we will use f-Strings to print strings and
variables.

More Resources:

1. [Link]
2. [Link]
3. [Link]

Weekly Challenge
Tasks:

1. Write a program that accepts user input to create a list of integers. Then, compute the sum of all the
integers in the list.
2. Create a tuple containing the names of five of your favorite books. Then, use a for loop to print each
book name on a separate line.
3. Write a program that uses a dictionary to store information about a person, such as their name, age, and
favorite color. Ask the user for input and store the information in the dictionary. Then, print the
dictionary to the console.
4. Write a program that accepts user input to create two sets of integers. Then, create a new set that
contains only the elements that are common to both sets.
5. Create a program that stores a list of words. Then, use list comprehension to create a new list that
contains only the words that have an odd number of characters.

These tasks should test your understanding of basic concepts related to lists, tuples, dictionaries, and sets in
Python. Good luck!

JULY 2025 COHORT RECORDING


Session 1

Session 2

Session 3
Week-3: Control flow & Functions in Python
Conditional statements.

As you start this lesson, make sure you have a good understanding of boolean variables and expressions since
they are building blocks of conditional statements.

Conditional statements help in the decision-making process, for example,

 “Are you hungry? If so, then eat” is a conditional statement

Phrased as: - If you’re hungry, then eat

Let's break this down to pick a boolean expression in our conditional statement.

 “Are you hungry” is the boolean expression here, so the conditional statement is checking if it’s True.
 If “are you hungry” == True, the conditional statement will be executed and you will eat.
 If [you are hungry], then [eat food]

In computer programming, we use the if statement to run a block code only when a certain condition is met.

In Python, there are three forms of the if...else statement.

1. if statement
2. if...else statement
3. if...elif...else statement

1. Python if Statement

The basic syntax for the if statement:

# Example of a basic if statement


temperature = 30

if temperature > 25:


print("It's a hot day!")

The if statement evaluates the condition.

1. If condition is evaluated to True, the code inside the body of if is executed.


2. If condition is evaluated to False, the code inside the body of if is skipped.
[Link]

Practice more on using if conditional statements with:

- Relational operators: (>, >=, <, <=)

- Boolean operators: (and, or, not)

2. Python if...else Statement

Syntax

# Example of an if-else statement


temperature = 20

if temperature > 25:


print("It's a hot day!")
else:
print("It's a cool day!")

If the condition evaluates to True,

 the code inside if is executed


 the code inside else is skipped

If the condition evaluates to False,

 the code inside else is executed


 the code inside if is skipped

[Link]

3. Python if...elif...else Statement

The if...else statement is used to execute a block of code among two alternatives.

However, if we need to make a choice between more than two alternatives, then we use the if...elif...else
statement.

The syntax of the if...elif...else statement is:

# Example of an if...elif...else statement


temperature = 15

if temperature > 25:


print("It's a hot day!")
elif temperature > 15:
print("It's a warm day!")
else:
print("It's a cold day!")

Here,

1. If the condition evaluates to true, code block 1 is executed.


2. If condition1 evaluates to false, then condition2 is evaluated.
3. If condition 2 is true, code block 2 is executed.
4. If condition 2 is false, code block 3 is executed.

Test YourSelf with the Question Below :

Write an if/elif/else statement for a college with a grading system as shown below:

 If grade is 90 or higher, print "A"


 Else if grade is 80 or higher, print "B"
 Else if grade is 70 or higher, print "C"
 Else if grade is 60 or higher, print "D"
 Else, print "F"

More Resources for if statements


[Link]

[Link]

Python Loops
In computer programming, loops are used to repeat a block of code. We perform a process of iteration
(repeating tasks).

There are 2 types of loops in Python:

 for loop
 while loop

Programming languages like Python implement two types of iteration:

1. Indefinite iteration, where the number of times the loop is executed depends on how many times a condition is
met.
2. Definite iteration, where the number of times the loop will be executed is defined in advance (usually based on
the collection size).

In a for loop, we will know in advance how many times the loop will need to iterate because we will be working
on a collection with a predefined length.

With for loops, on each iteration, we will be able to perform an action on each element of the collection.

For loop syntax:

# Example of a for loop


fruits = ["apple", "banana", "cherry"]

for fruit in fruits:


print(f"I love {fruit}!")
Example Explanation:

1. List: fruits is a list containing "apple", "banana", and "cherry".


2. Loop: The for loop iterates through each item in the list.
3. Action: During each iteration, fruit represents the current item, and print outputs a message for each fruit.

Let’s break down each of these components:

1. A for keyword indicates the start of a for loop.


2. A <temporary variable> is used to represent the value of the element in the collection the loop is currently on.
3. An in keyword separates the temporary variable from the collection used for iteration.
4. A <collection> to loop over. In our examples, we will be using a list.
5. An <action> to do anything on each iteration of the loop

[Link]

For Loops: Using Range

A range is a series of values between two numeric intervals.

We use Python's built-in function range() to define a range of values.

For example,

five_steps = range(5)

# five_steps is now a collection with 5 elements:

# 0, 1, 2, 3, 4

# Example of a for loop with range

for number in range(1, 6): # Loops from 1 to 5


print(f"Number: {number}")
Example Explanation:

1. range(1, 6): Generates numbers starting from 1 up to (but not including) 6.


2. Loop: The for loop iterates over each number in this range.
3. Action: During each iteration, number represent the current value, and print outputs it.

While Loops

A while loop performs a set of instructions as long as a given condition is true.

[Link]

While loop structure

# Example of a while loop


count = 1
while count <= 5:
print(f"Count: {count}")
count += 1 # Increment the counter
Explanation:

1. Initialization: count = 1 sets the starting value.


2. Condition: while count <= 5 keeps the loop running as long as count is less than or equal to 5.
3. Action: Inside the loop:
o It prints the current value of count.
o The count the variable is incremented by 1 (count += 1) to eventually meet the exit condition.

Loop controls: Break and continue

The break statement is used to terminate the loop immediately when it is encountered.

# Example of loop controls: break and continue


for number in range(1, 10): # Loop through numbers 1 to 9
if number == 5:
print("Breaking the loop at 5")
break # Exit the loop when number is 5
elif number % 2 == 0:
print(f"Skipping {number} because it's even")
continue # Skip the rest of the loop body for even numbers
print(f"Processing number: {number}")
Explanation:

1. break: Stops the loop entirely when number == 5.


2. continue: Skips the current iteration when number is even and moves to the next loop iteration.

Python continue Statement


The continue statement is used to skip the current iteration of the loop and the control flow of the program goes
to the next iteration.

While the break control statement will come in handy, there are other situations where we don’t want to end the
loop entirely. What if we only want to skip the current iteration of the loop?

Nested Loops

In Python, loops can be nested inside other loops. Nested loops can be used to access items of lists which are
inside other lists. The item selected from the outer loop can be used as the list for the inner loop to iterate over.

Example code

# Example of a nested loop


for i in range(1, 4): # Outer loop
for j in range(1, 4): # Inner loop
print(f"Outer loop: {i}, Inner loop: {j}")

More Resources for loops


[Link]
[Link]

[Link]

[Link]

[Link]

List comprehensions
List comprehensions in Python provide a concise and elegant way to create and manipulate lists. They offer a
more readable and expressive alternative to traditional loops for generating lists.

What is a List Comprehension?

A list comprehension is a compact syntax for creating a list by evaluating an expression for each element in an
iterable (like a list or range), optionally filtering elements based on a condition.

Syntax:

[expression for item in iterable if condition]

 expression: The value or transformation applied to each element.


 item: A variable that represents each element in the iterable.
 iterable: A sequence (like a list, tuple, or range) to iterate over.
 condition: (Optional) A filter that determines whether to include the element.

Basic Example
# Traditional loop
squares = []
for x in range(5):
[Link](x**2)

# List comprehension
squares = [x**2 for x in range(5)]
print(squares) # Output: [0, 1, 4, 9, 16]

Here, is the list of comprehension [x**2 for x in range(5)] creates a list of squares of numbers from 0 to
4.

Using Conditions in List Comprehensions

You can include a condition to filter items.

# List comprehension with a condition


even_numbers = [x for x in range(10) if x % 2 == 0]
print(even_numbers) # Output: [0, 2, 4, 6, 8]
Nested List Comprehensions

List comprehensions can be nested to handle complex operations, such as creating a matrix.

# Create a 3x3 matrix using nested list comprehensions


matrix = [[i * j for j in range(1, 4)] for i in range(1, 4)]
print(matrix) # Output: [[1, 2, 3], [2, 4, 6], [3, 6, 9]]
Examples of List Comprehensions

1. Transforming Data:

names = ["Alice", "Bob", "Charlie"]


uppercased_names = [[Link]() for name in names]
print(uppercased_names) # Output: ['ALICE', 'BOB', 'CHARLIE']

2. Filtering Data:

numbers = [10, 15, 20, 25, 30]


divisible_by_5 = [num for num in numbers if num % 5 == 0]
print(divisible_by_5) # Output: [10, 15, 20, 25, 30]

3. Flattening a List:

nested_list = [[1, 2], [3, 4], [5, 6]]


flat_list = [item for sublist in nested_list for item in sublist]
print(flat_list) # Output: [1, 2, 3, 4, 5, 6]
Advantages of List Comprehensions

1. Conciseness: More compact than traditional loops.


2. Readability: Easier to understand when used appropriately.
3. Performance: Faster than loops in many cases due to optimization.

When Not to Use List Comprehensions

While list comprehensions are powerful, they can become hard to read if they are too complex. In such cases,
traditional loops or generator functions may be more appropriate.

# Complex list comprehension (less readable)

result = [x * y for x in range(10) for y in range(5) if x + y > 5]

# Better as a loop (more readable)


result = []
for x in range(10):
for y in range(5):
if x + y > 5:
[Link](x * y)
Conclusion

List comprehensions are a versatile and efficient tool in Python, enabling you to write cleaner and faster code.
They are ideal for transforming, filtering, or generating lists in a Pythonic way. Start practicing them to enhance
your coding skills!
Python Functions
Functions are a fundamental part of Python programming. They allow you to encapsulate reusable blocks of
code to make programs modular, easier to understand, and maintain.

What is a Function?

A function is a block of code designed to perform a specific task. You define a function once and can use it
multiple times throughout your code.

Syntax:

def function_name(parameters):
"""Optional docstring explaining the function."""
# Code block
return value # Optional return statement

Types of Functions

1. Built-in Functions: Predefined functions in Python (e.g., print(), len(), type()).


2. User-defined Functions: Functions created by the user.

Defining and Calling a Function

Here’s how you define and call a function in Python:

# Function definition
def greet(name):
"""Greet a person by their name."""
return f"Hello, {name}!"

# Function call
print(greet("Alice")) # Output: Hello, Alice!

Key Components of a Function

1. Function Name: Should be descriptive and follow naming conventions.


2. Parameters: Variables passed into the function.
3. Docstring: An optional description of what the function does.
4. Return Statement: Outputs a value from the function (optional).

Parameters and Arguments

Functions can accept zero or more arguments.

1. Positional Arguments:

def add(a, b):


return a + b
print(add(3, 5)) # Output: 8

2. Default Arguments:

def greet(name="Guest"):
return f"Hello, {name}!"

print(greet()) # Output: Hello, Guest!


print(greet("Alice")) # Output: Hello, Alice!

3. Keyword Arguments:

def introduce(name, age):


return f"My name is {name}, and I'm {age} years old."

print(introduce(age=25, name="Bob")) # Output: My name is Bob, and I'm 25 years old.

Returning Values

A function can return values using the return statement.

def square(number):
return number ** 2

result = square(4)
print(result) # Output: 16

Anonymous Functions: Lambda

Python supports anonymous functions using the lambda keyword. They are useful for short, simple functions.

# Lambda function for adding two numbers


add = lambda x, y: x + y
print(add(3, 5)) # Output: 8

# Using lambda with map()


numbers = [1, 2, 3, 4]
squares = list(map(lambda x: x**2, numbers))
print(squares) # Output: [1, 4, 9, 16]

Recursive Functions

A function can call itself, enabling recursive problem-solving.

def factorial(n):
if n == 1:
return 1
return n * factorial(n - 1)

print(factorial(5)) # Output: 120


Benefits of Functions

1. Reusability: Write once, and use multiple times.


2. Modularity: Break programs into smaller, manageable parts.
3. Improved Readability: Descriptive names make code easier to understand.

Conclusion

Functions are a powerful tool that makes your code cleaner, more efficient, and easier to maintain. Mastering
their use is essential for any Python developer. Start experimenting with different types of functions to
understand their versatility!

Weekly Code Challenge

Coding Challenges for basic control flows and functions

1. Large Power
Create a method that tests whether the result of taking the power of one number to another number provides an
answer which is greater than 5000. We will use a conditional statement to return True if the result is greater
than 5000 or return False if it is not. In order to accomplish this, we will need the following steps:

1. Define the function to accept two input parameters called base and exponent
2. Calculate the result of base to the power of exponent
3. Use an if statement to test if the result is greater than 5000. If it is then return True. Otherwise, return False

Coding Question
Create a function named large_power() that takes two parameters named base and exponent.

If base raised to the exponent is greater than 5000, return True, otherwise return False

[Link] By Ten
Create a function that determines whether or not a number is divisible by ten. A number is divisible by ten if the
remainder of the number divided by 10 is 0. Using this, we can complete this function in a few steps:

1. Define the function header to accept one input num


2. Calculate the remainder of the input divided by 10 (use modulus)
3. Use an if statement to check if the remainder was 0. If the remainder was 0, return True, otherwise, return False

Coding question
Create a function called divisible_by_ten() that has one parameter named num.
The function should return True if num is divisible by 10, and False otherwise. Consider using modulo
operator % to check for divisibility.

Python Control Flows and Functions Recording


Session 1

Session 2

Session 3
Week 4: File Handling & Exception Handling
[Link]
SHA256&X-Amz-Credential=SCW1GD83Z2RS0PZEWJNW%2F20250923%2Ffr-par%2Fs3%2Faws4_request&X-Amz-Date=20250923T141441Z&X-Amz-Expires=518400&X-Amz-
SignedHeaders=host&X-Amz-Signature=b2c6bebd68fe216b953b6a4fb870909925b62deb42c6257fae849b2060131153

Objectives Of the Topic 🌟

 Master Files: Get hands-on with opening, reading, writing, and closing files in Python!
 Handle Errors Like a Pro: Learn how to catch and manage errors, ensuring your code runs smoothly even when
things don’t go as planned.

What is File Handling? 📁

File Handling in Python is the ability to perform various operations on files, like reading from and writing to
them. Files are used to store data permanently (like text documents, images, or spreadsheets). Unlike variables,
which lose their values when a program ends, files provide persistent storage.

File handling in Python allows you to:

1. Open files in different modes (e.g., read-only or write mode).


2. Read and write data in a variety of formats.
3. Close files to free up system resources.

Python’s built-in open() function is at the heart of this process, and learning how to handle files can make
your programs more robust, flexible, and useful.

File Operations in Python 🚪🔑 (1.5 hours)

Let’s start with the basics of file handling!

 Opening Files 🔓
o Use Python’s open() function to access a file.
o Syntax: open(filename, mode), where:
 filename: The name of the file you want to work with.
 mode: The mode you want to open the file in.
o Modes include:
 'r': Read mode, used for reading files.
 'w': Write mode, creates a new file or overwrites an existing one.
 'a': Append mode, adds new content without deleting existing data.
 'rb', 'wb': Binary modes for non-text files, like images.

Example:

file = open("[Link]", "r") # Opens the file in read mode

 Reading Files 📜
o Python provides multiple ways to read file contents:
 .read(): Reads the entire file.
 .readline(): Reads a single line at a time.
 .readlines(): Reads all lines and returns a list.
o Example:
with open("[Link]", "r") as file: data = [Link]() print(data)

o Use cases: Processing large datasets or analyzing text documents.


 Writing & Appending to Files ✍️
o Writing is essential for saving data, like storing a user’s progress or keeping a record.
o write(): Overwrites content, while append() allowing adding without deleting.
o Example:

with open("[Link]", "w") as file: [Link]("Hello, Python!")

 Closing Files 🚪
o Files should be closed after processing to release system resources.
o Python’s with statement automatically handles closing, ensuring efficient resource management.

Exception Handling 🌪️
Errors happen! To make sure your programs are error-proof and user-friendly, Python provides Exception
Handling. It’s the art of catching errors and handling them gracefully.

 Basic Structure of try-except Blocks ⚙️


o try: Runs code that might throw an error.
o except: Catches the error, allowing you to respond without crashing.
o Example

try:
with open("[Link]", "r") as file:
data = [Link]()
except FileNotFoundError:
print("File not found. Please check the filename.")

Advanced Error Handling with finally and Custom Errors 🎩

 finally: Runs no matter what, often used to clean up (like closing a file).
 Custom Errors: Create custom exceptions for special cases (e.g., EmptyFileError).

Example with finally:

try:
file = open("[Link]", "r")
data = [Link]()
except FileNotFoundError:
print("File not found.")
finally:
[Link]()
Best Practices 📏

 Use with for file handling: Auto-close files, preventing potential leaks.
 Check file existence before reading/writing, to avoid crashes.
 Handle specific exceptions over general ones (e.g., FileNotFoundError instead of Exception).
 Document error messages clearly for easier debugging and user support.
File Handling and Exception Handling Recording
(Right click on a link to open on a new tab)

Github Links:

[Link]

[Link]

Live Class Recordings

Session 1 Recording

Session 2 Recording

Session 3 Recording

Weekly code Challenge

Create a program that reads a text file, processes its content, and writes the results to a new file.

📌 Task Requirements:

1. Create a file called [Link] and write at least five lines of text into it.
2. Write a Python script to:
o Read the contents of [Link].
o Count the number of words in the file.
o Convert all text to uppercase.
o Write the processed text and the word count to a new file called [Link].
3. Print a success message once the new file is created.
Week 5: Object Oriented Programming
Introduction to OOP: Classes, Objects, Attributes, and Methods (1 hour) 🏫

What’s OOP?
Imagine everything as objects — a car 🚗, a book 📚, or even a cute little puppy 🐶. OOP helps us model
complex systems by treating real-world entities as objects within the program. We assign them classes (their
blueprint), attributes (their characteristics), and methods (their actions)!

Key Concepts:

 Class: The blueprint or prototype, like a recipe 🍲! Defines the structure for creating objects.
 Object: A specific instance of a class. Think of it as a cake made from that recipe 🎂.
 Attributes: Characteristics or properties of an object, like the color of a car.
 Methods: Actions or behaviors that the object can perform (e.g., drive() for a car).

Example: Create Your First Class!

# Defining a class

class Car:
color = "red" # Attribute

# Method
def drive(self):
print("The car is driving 🚗")

# Creating an object
my_car = Car()
print(my_car.color)
my_car.drive()

Constructors in Python OOP


Constructors: The __init__ Method and Instance Variables 🚀

What’s a Constructor? Every time you create a new object, you want it to have its unique attributes (color,
model, etc.). Constructors (__init__ methods) allow each object to start with specific values. It’s like building
a pizza 🍕 with the toppings you want!

Instance Variables
Instance variables are specific to each object and can vary across objects. For example, two Car objects can
have different colors, models, and speeds.

Example: Setting Up Your Constructor!

class Car:

def __init__(self, color, model):


[Link] = color # Instance variable
[Link] = model # Instance variable

# Creating objects with unique attributes


car1 = Car("blue", "Sedan")
car2 = Car("red", "SUV")

print([Link]) # Output: blue


print([Link]) # Output: SUV

OOP Principles: Inheritance, Polymorphism, and Encapsulation

 Inheritance 👨👩👧👦: Just like humans inherit traits from their parents, classes can inherit attributes
and methods from other classes. This helps reduce code repetition and create a natural hierarchy in your
code!
o Example: Imagine a Vehicle class with general features (like wheels). We can create subclasses like
Car and Bike that inherit those features!

python

class Vehicle:

def __init__(self, wheels):


[Link] = wheels

class Car(Vehicle):
pass

car = Car(4)
print([Link]) # Output: 4

Polymorphism 🦄: Derived classes can behave differently for the same method inherited from a base
class. With polymorphism, a method name can mean different things across multiple classes.

o Example: Imagine a speak() method. Dogs bark(), while cats meow(), even though both use
speak()!

class Dog:

def speak(self):
return "Woof!"

class Cat:
def speak(self):
return "Meow!"

# Polymorphism in action
for animal in [Dog(), Cat()]:
print([Link]())

Encapsulation 🔐: This is the practice of keeping attributes and methods private to prevent unwanted
interference from outside the class. It’s like hiding your chocolate stash 🍫 from everyone else!

class SecretStash:
def __init__(self):
self.__chocolates = 10 # Private attribute

def take_chocolate(self):
if self.__chocolates > 0:
self.__chocolates -= 1
print("One chocolate taken!")
else:
print("No chocolates left 😢")

stash = SecretStash()
stash.take_chocolate()

In Summary
OOP allows you to organize code in a way that’s fun, reusable, and efficient! As you practice, imagine
the real-world objects around you and think of how they could become classes in your code. Whether
you’re designing a Smartphone, Pet, or Superhero, OOP gives you the power to build programs that
feel like real-world systems.

July Cohort OOP In Python Recording


Right click on the links below to open the recordings on a new tab!

Session 1

Session 2

Session 3

Github Link

POOP

Presentation

POOP

CatchUp Session

POOP_CatchUp
Week 6: Python Libraries
🎯 Learning Objectives

By the end of this lesson, learners should be able to:

 Understand what a Python library is.


 Know how to install and import a library.
 Use popular libraries like math, random, and datetime with simple examples.
 Practice with short, fun tasks using these libraries.

🧠 What is a Python Library?

A Python library is a collection of pre-written code that you can use to perform common tasks without having to write
everything from scratch.

Think of it like a toolbox. If you're building something, instead of making your own hammer, you just pull one out from
the toolbox!

🔧 How to Use a Library in Python


✅ 1. Importing a Built-in Library

Python has many built-in libraries (you don’t need to install them).

Example: math

import math
print([Link](16)) # Output: 4.0
print([Link]) # Output: 3.141592653589793

✅ 2. Importing Part of a Library

Sometimes, you don’t need the whole toolbox.

from math

print("Square root of 36:", [Link](36))


print("Sine of 90 degrees:", [Link]([Link](90)))
print("Power of 2^3:", [Link](2, 3))

🎲 2. random – Generate random numbers


import random

print("Random number between 1 and 10:", [Link](1, 10))


print("Random choice from a list:", [Link](['apple', 'banana', 'cherry']))
⏰ 3. datetime – Work with dates and time
import datetime

today = [Link]()
print("Today's date is:", today)

now = [Link]()
print("Current time:", [Link]("%H:%M:%S"))

Installing Python Packages – Simple Summary

Python has lots of built-in tools (standard library), but sometimes you'll need more. That’s where third-party packages
come in — extra tools made by the community.

pip

 pip is Python’s tool for installing packages.


 It stands for "Pip Installs Packages".
 If you’re using Python 3.4 or newer, you already have pip3.
 To install a package, just run: pip install package_name

PyPI

 PyPI (Python Package Index) is the place where all these third-party packages live.
 pip automatically pulls packages from PyPI.
 You can also visit [Link] to search for packages manually.

Popular third-party libraries


PyPI has thousands of packages, it would be impossible to summarize them all. But there are a handful of go-to
packages that many people use for common tasks:

 requests
 scrapy
 Twisted
 Pillow
 lxml
 PyYAML
 Django, Flask, Pyramid
 SQLAlchemy
 numpy, scipy, pandas
 pytest, tox, coverage, mock
 six
 Jinija2
 cryptography
 pylint, flake8, pep8
 pymongo, redis, MySQL-Python, psycopg2

Resources:

1. [Link]
Python Standard Library

The Python Standard Library is a collection of built-in modules that come with Python. These modules help you do
common tasks like reading files, working with dates, or handling math — without installing anything extra.

Popular Extra Python Libraries:

 TensorFlow – For machine learning and deep learning.


 Matplotlib – For creating charts and graphs.
 Pandas – For handling and analyzing data.
 NumPy – This is for working with numbers and large arrays.
 SciPy – For scientific and technical computing.
 Scrapy – For web scraping (getting data from websites).
 Scikit-learn – For machine learning (like predictions and classifications).
 PyGame – For building games with graphics and sound.
 PyTorch – For deep learning and neural networks.
 PyBrain – For beginners in machine learning and AI.

There are many more libraries in Python. We can use a suitable library for our purposes. Hence, Python
libraries play a very crucial role and are very helpful to the developers.

What is NumPy?

NumPy stands for Numerical Python.


It’s used for:

 Working with large arrays and matrices


 Performing math operations on arrays

🔧 Installing NumPy
pip install numpy
✨ Basic NumPy Example
import numpy as np

# Create a simple array


my_array = [Link]([1, 2, 3, 4, 5])
print("Array:", my_array)

# Perform operations
print("Array * 2:", my_array * 2) # Multiply each element by 2
print("Mean:", [Link](my_array)) # Average of the array
print("Square Roots:", [Link](my_array))

🎲 Practice Task (NumPy)

1. Create an array with numbers 10 to 50.


2. Find the maximum and minimum values.
3. Multiply all elements by 3.
What is Pandas?

Pandas is used for data manipulation and analysis.


It allows you to:

 Work with tables (just like Excel or Google Sheets!)


 Clean and filter data easily
 Read from CSV, Excel, JSON, etc.

🔧 Installing Pandas
pip install pandas
✨ Basic Pandas Example
import pandas as pd

# Create a DataFrame (table-like structure)


data = {
'Name': ['Alice', 'Bob', 'Charlie'],
'Age': [24, 30, 22],
'Score': [85, 90, 95]
}

df = [Link](data)

print(df)

# Access column
print("Names:", df['Name'])

# Filter rows
print("Scores above 90:")
print(df[df['Score'] > 90])
📁 Reading CSV Files with Pandas
df = pd.read_csv('[Link]')
print([Link]()) # Show first 5 rows

📊 Practice Task (Pandas)

1. Create a DataFrame with 3 students: name, age, and grade.


2. Add a column called “Passed” where grade > 50 = True.
3. Filter and display only students who passed.

Data Visualization with Matplotlib


Matplotlib is used to create charts and graphs like line graphs, bar charts, pie charts, and more.

🧠 What is Matplotlib?

Matplotlib is a library that allows you to create visual representations of your data. It’s especially useful when working
with data in Pandas or NumPy.
🔧 Installing Matplotlib
pip install matplotlib
📈 Basic Line Plot
import [Link] as plt

# Sample data
x = [1, 2, 3, 4, 5]
y = [10, 20, 25, 30, 40]

# Create a line plot


[Link](x, y)
[Link]("Simple Line Plot")
[Link]("X-axis")
[Link]("Y-axis")
[Link]()
📊 Bar Chart Example
# Sample data
names = ['Alice', 'Bob', 'Charlie']
scores = [85, 90, 78]

[Link](names, scores, color='skyblue')


[Link]("Student Scores")
[Link]("Students")
[Link]("Scores")
[Link]()
🍰 Pie Chart Example
# Sample data
activities = ['Sleeping', 'Eating', 'Coding', 'Gaming']
hours = [8, 2, 8, 6]

[Link](hours, labels=activities, autopct='%1.1f%%')


[Link]("Daily Activities")
[Link]()
📏 Histogram Example
# Example: showing frequency of values
ages = [22, 21, 20, 23, 24, 22, 20, 21, 22, 25, 23]

[Link](ages, bins=5, color='purple')


[Link]("Age Distribution")
[Link]("Age")
[Link]("Frequency")
[Link]()

💡 Combine with Pandas Example


import pandas as pd

# Create a DataFrame
data = {
'Year': [2021, 2022, 2023],
'Users': [1500, 3000, 5000]
}

df = [Link](data)

# Plot using pandas + matplotlib


[Link](df['Year'], df['Users'], marker='o')
[Link]("User Growth Over Time")
[Link]("Year")
[Link]("Users")
[Link](True)
[Link]()

🧠 Practice Tasks

1. Create a bar chart showing 5 different countries and their population.


2. Create a pie chart showing how a student spends 24 hours of their day.
3. Make a line chart that shows temperature changes during the day (morning, noon, evening, night).

July 2025 Cohort Recordings


Right Click on the Links Below to Open in a New Tab

Session 1

Session 2

Session 3

Presentation

GitHub Repo

CatchUp Session
Week 7: Basic Data Analysis
Objectives:

 Use Python libraries to handle and analyze data.


 Learn to perform basic data manipulation with pandas.
 Understand data analysis techniques such as filtering, sorting, and aggregating data.
 Gain insight into data visualization using matplotlib.

Introduction to Pandas: Creating, Reading, and Manipulating DataFrames

What is pandas?

pandas is an open-source Python library that provides high-performance, easy-to-use data structures and data
analysis tools. It is primarily used for working with tabular data in the form of DataFrames. It allows you to
efficiently manipulate, clean, and analyze structured data.

 Series: A one-dimensional labeled array that can hold any data type (integers, strings, etc.).
 DataFrame: A two-dimensional, size-mutable, potentially heterogeneous tabular data structure with labeled
axes (rows and columns).

Key Operations in pandas:

 Creating DataFrames: You can create a DataFrame by loading data from various formats like CSV,
Excel, or SQL databases. For example:

import pandas as pd

# Creating DataFrame from a dictionary


data = {'Name': ['Alice', 'Bob', 'Charlie'],
'Age': [25, 30, 35],
'City': ['New York', 'Los Angeles', 'Chicago']}

df = [Link](data)
print(df)

Reading Data: pandas allows you to load data from multiple sources, such as:

# Read data from a CSV file


df = pd.read_csv('[Link]')

Manipulating DataFrames:

 Selecting Columns: You can select a specific column like this:

df['Age'] # Selects the Age column

 Filtering Rows: You can filter rows based on a condition:

df[df['Age'] > 30] # Returns rows where Age > 30


 Adding/Removing Columns:
 df['Country'] = ['USA', 'USA', 'USA'] # Adds a new column
[Link]('Country', axis=1, inplace=True) # Drops the 'Country' column
Data Analysis Techniques: Filtering, Sorting, and Aggregating Data (1.5 hours)
Filtering Data

 Basic Filtering: To filter data based on conditions, you can use boolean indexing.
 # Get rows where Age is greater than 30
df_filtered = df[df['Age'] > 30]

 Multiple Conditions: You can combine multiple conditions using logical operators:
 # Get rows where Age is greater than 30 and City is 'New York'
df_filtered = df[(df['Age'] > 30) & (df['City'] == 'New York')]

 Sorting Data
o Sorting by Columns: You can sort the DataFrame by a column in ascending or descending
order:

df_sorted = df.sort_values(by='Age', ascending=False) # Sort by Age in


descending order

Sorting by Multiple Columns:

df_sorted = df.sort_values(by=['Age', 'City'], ascending=[True, False])


Aggregating Data

 Groupby: pandas groupby method is essential for aggregating data based on one or more columns. For
example:

grouped = [Link]('City').agg({'Age': 'mean', 'Name': 'count'})


print(grouped)

 Summary Statistics: pandas provide several built-in functions to calculate summary statistics:

df['Age'].mean() # Mean of 'Age' column


df['Age'].sum() # Sum of 'Age' column
df['Age'].max() # Maximum of 'Age' column

Data Visualization Basics with matplotlib


Introduction to matplotlib

matplotlib is a comprehensive library for creating static, animated, and interactive visualizations in Python. It's
often used for visualizing the results of data analysis. The most common form of visualization is through line
plots, scatter plots, bar plots, and histograms.

Basic Plotting with matplotlib

 Simple Line Plot:


 import [Link] as plt

 # Plotting Age vs. Name
 [Link](df['Name'], df['Age'])
 [Link]('Name')
 [Link]('Age')
 [Link]('Name vs Age')
[Link]()

 Bar Plot:
 # Plotting a bar chart for Age by City
 [Link]('City')['Age'].mean().plot(kind='bar')
 [Link]('City')
 [Link]('Average Age')
 [Link]('Average Age by City')
[Link]()

 Histogram:
 # Plotting a histogram for Age
 df['Age'].plot(kind='hist', bins=10)
 [Link]('Age')
 [Link]('Age Distribution')
[Link]()

 Scatter Plot:
 # Plotting a scatter plot of Age vs. City
 [Link](kind='scatter', x='City', y='Age')
 [Link]('City vs Age')
[Link]()
Customizing Plots

 Adding Labels and Title:


 [Link]('City')
 [Link]('Average Age')
[Link]('Average Age by City')

 Color and Style:

df['Age'].plot(kind='line', color='green', linestyle='--', linewidth=2)

Best Practices for Working with Data and Basic Data Analysis:

1.
1. Data Cleaning: Before analysis, always ensure the data is clean. This includes handling missing
values ([Link]()), removing duplicates (df.drop_duplicates()), and dealing with
outliers.
2. Efficient Data Access: pandas provides several ways to read large datasets efficiently. For
example, use chunksize to read large CSV files in chunks.
3. Handling Data Types: Ensure the data types of your columns are correct (e.g., using df['Age']
= df['Age'].astype(int)).
4. Documentation: When working on analysis, make sure to document your code and the
reasoning behind each transformation or computation.
Additional Resources:

 pandas Documentation: [Link]


 matplotlib Documentation: [Link]

By completing these exercises and concepts, learners will gain a solid foundation in handling and analyzing
data using pandas and matplotlib. These skills will be essential for performing data-driven tasks like cleaning,
analyzing, and visualizing data.

July 2025 Cohort Recordings


Right Click on the Links Below to Open in a New Tab

Session 1

Session 2

Session 3

Presentation

Github Repo

Catchup Session
Catchup Session Repo

Weekly Code Challenge


Python Data Analysis Challenge

🔹 Challenge: Perform basic data analysis on a CSV file and generate insights!

📌 Task Requirements:

1. Download or create a CSV file called sales_data.csv with the following columns:
o Date (YYYY-MM-DD)
o Product
o Quantity Sold
o Revenue ($)
2. Write a Python script to:
o Load the CSV file using pandas.
o Calculate the total revenue.
o Find the best-selling product (based on Quantity Sold).
o Identify the day with the highest sales.
o Save the results to a new file called sales_summary.txt.
3. Print the insights in a user-friendly format.

🎯 Bonus Challenge:

 Visualize sales trends using matplotlib or seaborn.


🔹 Example CSV (sales_data.csv):

Quantity
Date Product Revenue ($)
Sold

2025-03-01 Laptop 5 5000

2025-03-01 Mouse 15 300

2025-03-02 Laptop 3 3000

2025-03-02 Keyboard 8 800

🔹 Expected Output (sales_summary.txt):

Total Revenue: $9,100


Best-Selling Product: Mouse (15 units sold)
Highest Sales Day: 2025-03-01

🚀 Ready? Analyze the data and share your insights!


Week 8: Python Frameworks
Introduction: The Role and Value of Python Frameworks
Python, as one of the most versatile and popular programming languages in the world, is widely utilized in web
development, data science, artificial intelligence, and beyond. Its adoption spans from start-ups to leading
global enterprises, offering both a gentle learning curve and the depth needed for complex, scalable systems.
Central to Python’s success is its extensive ecosystem of frameworks—software libraries that provide a
structured, reusable foundation for development.

Frameworks save developers from repetitive coding tasks, streamline project architecture, inject security best
practices, and often supercharge productivity by enforcing modular designs and “batteries-included”
philosophies. For learners and developers, understanding the diverse landscape of Python frameworks is crucial
for selecting the right tool for varying technical challenges, resource settings, and organizational needs, whether
building for local SMBs or aiming at international impact.

Below, we examine a carefully selected array of both mainstream and niche Python frameworks, analyzing each
in terms of its purpose, core functionalities, project orientation, practical usage, advantages and limitations, and
recommended scenarios for application. Learners will find guidance on when and why to prefer particular
frameworks considering regional constraints and ambitions.

Summary Table: Key Attributes of Major Python Frameworks


Core Project
Framework Purpose Advantages Limitations Fit Scenarios
Functionalities Orientation

ORM, admin,
Large, robust, Rapid Enterprise
routing, Heavyweight,
Django Full-stack web database-driven prototyping, apps, data
authentication, less flexible
web apps security, scale platforms
templating

APIs,
URL routing, Lightweight, Few built-ins, APIs, small
microservices,
Flask Microframework templating, modular, manual apps, custom
SPAs,
minimal core flexible integrations projects
prototyping

Async support, type REST APIs, Performance, Steep async AI/ML APIs,
FastAPI High-perf API hints, auto docs, ML/AI, async docs, async- learning, real-time
data validation apps ready minimal core systems

Customizable, Extensible, Learning curve, Modular web


Varies: micro to
Pyramid Flexible/scalable plugins, ORM minimal to smaller apps, evolving
enterprise
optional, security complex community needs

Non-blocking IO, Real-time, high- Async Chat,


Async Scalability,
Tornado websockets, HTTP concurrency complexity, streaming, IoT,
networking async-first
server apps limited plugins fintech
Core Project
Framework Purpose Advantages Limitations Fit Scenarios
Functionalities Orientation

All-in-one file,
Simplicity, Rapid protos,
minimal Small apps, Not scalable,
Bottle Microframework single file, no teaching,
dependencies, easy prototyping, IoT few built-ins
deps scripts
routing

HTTP server, config, DB-driven apps, OOP, Steep learning, Teaching,


CherryPy Object-oriented plugins, OOP web smaller web modifiable, aging small-to-
dev services built-in server ecosystem medium apps

RESTful, Mission-critical Speed, Sparse APIs at scale,


Falcon API gateway minimalism, async, APIs, simplicity, features, config cloud
high performance microservices reliability overhead microservices

Websockets, Real-time web, Very fast, Real-time apps,


Less mature
Sanic Async web async/await, speed, APIs, async-first production- rapid async
ecosystem
middleware apps ready async APIs

Auto admin, ORM, Secure, Ease, security, Outdated, less


Teaching,
Web2py Full-stack rapid built-in security, enterprise, edu battery- modern
CRUD, intranet
MVC apps included features

Scalable, supports Modular apps, Grows with Startups,


Complexity,
TurboGears Extensible full micro/fullstack, scalable needs, growing orgs,
less popular
ORM, widgets platforms flexibility teaching

Widgets, rapid ML, data Data focus, Analytics, ML


Not general
Streamlit Data app proto prototyping, data science, very easy, live demos,
web framework
vis, minimal setup dashboards update education

Plotly integration, Data viz, Interactive, Custom UI


BI dashboards,
Dash Analytical web UI widgets, business analytical, pure limits, learning
analytics
dashboards intelligence Python curve

Ties with viz libs,


Data apps, PyData
notebooks, Complex for Data scientists,
Panel Dashboarding dashboards, ecosystem,
widgets, pipeline beginners dashboards
research tools flexibility
support

ML UI builder, easy Easiest for ML ML demos,


ML apps, demos, Not for general
Gradio ML interfaces sharing, multi- demos, fast interactive
model GUIs web dev
modal input/output sharing teaching

Each of these frameworks receives detailed, paragraph-driven analysis—see sections that follow for deep dives,
practical code examples, and scenario recommendations.
Recommendations for Learners in: How to Choose
 For Absolute Beginners and Educators: Start with Bottle for basics, then move to Flask (for hands-on experience
of routing, templates, and coding conventions).
 For Database-Driven, Multi-User Web Applications: Django is king due to its maturity, documentation, security,
and scalability.
 For Rapid API Development or High-Performance, Real-Time Requirements: FastAPI (modern APIs, async) or
Tornado (low-level real-time control).
 For Modular, Evolving Projects: Pyramid or TurboGears—allowing start-small, scale-later approaches, suited for
start-ups or projects with uncertain requirements.
 For Data Science, Analytics, Machine Learning: Streamlit for dashboard/data exploration, Dash for interactive
data viz, Panel for advanced workflows, Gradio for ML model demos.
 For Learning Modern Python async: FastAPI or Sanic—both offer real concurrency, preparing you for scalable
systems and cloud native architectures.
 For IoT, Embedded, or Prototyping: Bottle (ultra-lightweight, single-file deployment).

Conclusion
The breadth of Python frameworks ensures there is “the right tool for every job,” whether you are in a Kenyan
classroom, a Nairobi fintech startup, or a global open-source research team. By understanding the purpose,
strengths, limitations, and ideal use cases of each major framework, learners and developers truly empower
themselves to build not only robust, scalable applications, but also to choose tools that best fit their problem,
knowledge level, and local context.

The path to becoming a skilled Python developer involves not just coding, but learning when and why to
employ (or avoid) each framework. Use this guide as a reference and platform for continued research, as the
Python ecosystem continues to evolve, welcoming newcomers and powering innovation worldwide.

Django
Purpose

Django is a high-level, full-stack web framework championed for rapid development and pragmatic design. It follows the
“batteries-included” philosophy, providing every major component needed for robust database-driven applications,
reducing the need for repetitive code and integrating best practices by default.

Core Functionalities

 Object-Relational Mapping (ORM): Seamlessly maps Python classes to database tables, abstracting SQL and
offering database portability.
 Automated Admin Interface: Generates a powerful admin backend for CRUD operations.
 Routing (URL Dispatcher): Sophisticated, human-readable URL organization.
 Authentication & Authorization: Built-in user management, permissions, and group handling.
 Templating System: Secure and dynamic HTML rendering.
 Security Features: Out-of-the-box CSRF protection, session management, security middleware, and more.

Project Orientation
Django is suited for large-scale, database-driven applications, including social media platforms, financial platforms,
content management systems, and marketplaces. It is particularly effective for rapidly prototyping secure, production-
grade apps that are likely to experience scaling needs over time.

Model Example

# A minimal Django project: 'Hello World' view.


from [Link] import HttpResponse
from [Link] import path

def hello_world(request):
return HttpResponse("Hello, Django World!")

urlpatterns = [
path('', hello_world),
]

To run this, the developer would integrate it into Django’s URL configuration and launch the app via python [Link]
runserver after initializing a project.

Advantages

Django’s strengths lie in productivity, security, scalability, and community. Its mature ecosystem and comprehensive
documentation mean developers can quickly build, test, and deploy complex projects without reinventing the wheel.
The admin panel saves weeks of development, the ORM removes much of the hassle of SQL, and baked-in protections
guard against common vulnerabilities. Companies like Instagram, Spotify, and Mozilla illustrate its capacity for
enterprise-grade projects. The vibrant community ensures learners find extensive global resources.

Limitations

As a “heavy” framework, Django can be too opinionated or restrictive for projects requiring greater flexibility. Integrating
non-Django tools or architectures (e.g., advanced async, custom ORMs) involves complex workarounds or re-architecting
parts of the stack. For the simplest microservices, Django’s bulk introduces unnecessary complexity and overhead.

Guidance for Learners

Django is ideal for learners seeking marketable, full-stack web development skills or aiming for
enterprise/organizational freelance opportunities. Its strong documentation and security focus mean beginners build
“correct” structures out of the gate. Use Django for:

 Business and school management systems


 E-commerce or payment platforms
 Social communities or resource-sharing
 Any application likely to scale in features and users

For microservices or quick REST APIs, lighter frameworks may be preferable.


Flask
Purpose

Flask is a minimalist, “micro” web framework designed to offer the essentials: routing, request/response
handling, and templating, while staying out of the developer’s way. Its design encourages extensibility—
developers bolt on only what they need, resulting in highly tailored application stacks.

Core Functionalities

 Routing: Maps URLs to Python functions with decorator syntax.


 Jinja2 Template Engine: Elegant, secure templating for dynamic page rendering.
 WSGI (Werkzeug) Foundations: Stable, flexible server interface.
 Sessions, Cookies, Static Assets: Basic essentials for most web apps.
 Extensible Plugin System: Thousands of community extensions for database, auth, forms, and more.

Project Orientation

Flask’s sweet spot is small to medium-sized web apps, RESTful APIs, microservices, and quick
prototypes. It is especially favored for projects needing custom application structures or for teaching core web
concepts due to its simplicity.

Model Example

from flask import Flask

app = Flask(__name__)

@[Link]("/")
def hello_world():
return "Hello, Flask!"

if __name__ == '__main__':
[Link](debug=True)

Launching python [Link] starts a local server at [Link] by default.

Advantages

Flask rewards simplicity, flexibility, and control. It puts almost no restrictions on project architecture, so
learners are exposed to “real” web app composition. Its minimalism encourages learning by building—the
developer chooses their ORM, admin, authentication, and more as needed. This modularity is valuable for
educational settings where understanding each moving part is the key goal. The community is robust, and
there’s strong extension support.

Limitations

While freedom is a strength, it is also a potential risk: Flask apps can become difficult to maintain as
complexity grows if there are not strong internal conventions. Many essential features (user management,
admin, form validation) require additional setup and often, extension selection can cause confusion or
incompatibility for beginners. It is rarely the right choice for large, standardized teams or for projects needing
rapid scaling with minimal configuration.

Guidance for Learners

Flask is a superb teaching framework and is also recommended for rapid prototyping, lightweight APIs, or
microservices in start-ups and SMEs. Great use cases include:

 Educational coding projects or bootcamps


 Backend APIs for mobile apps
 Small-organization websites or event/club platforms
 Early-stage MVPs needing custom workflows
 RESTful microservices for larger Django-based platforms

However, for long-term large-scale sites, consider Django or a hybrid approach

Streamlit
Purpose

Streamlit is an open-source Python framework for rapidly turning data scripts into interactive web apps with
only a few lines of code and zero front-end knowledge34. It is purpose-built for data scientists and ML
engineers to share results visually and interactively—no HTML, CSS, or JS required.

Core Functionalities

 Interactive Widgets & Components: Sliders, inputs, data tables, and more.
 Live Re-running: Instant UI updates as the Python script changes.
 Auto Integration with pandas, matplotlib, Plotly: Seamless for data vis.
 Simple API: Minimal learning curve for anyone familiar with Python.

Project Orientation

Streamlit is ideal for data exploration tools, ML model prototyping and demos, quick interactive
dashboards, and classroom data science demonstrations.

Model Example
python

import streamlit as st
import pandas as pd

[Link]("## Hello, Streamlit!")


df = [Link]({'A':[1,2,3], 'B':[4,5,6]})
st.line_chart(df)

Launch via streamlit run [Link] and view live updates in your browser.
Advantages

Supremely simple and fast for ML/data prototyping. Learners can go from dataset to web app in minutes.
Automatic, responsive UIs are generated for Python functions, aiding collaboration and reproducibility in data
science workflows.

Limitations

Not suitable for general-purpose web development; limited customization of UI and navigation. For production-
grade or highly trafficked apps, performance can suffer. Streamlit is not meant for apps needing complex
authentication or back-end integrations.

Guidance for Learners

For data science students, ML enthusiasts, researchers, and educators, Streamlit is a must-learn. Use
Streamlit to:

 Share Jupyter-like data apps with stakeholders


 Build real-time dashboards for local businesses or research teams
 Prototype machine learning models in hackathons or university competitions

For full-stack web apps or standardized UIs, switch to Dash, Flask, or Django.

Dash
Purpose

Dash by Plotly is an open-source Python framework specifically tailored for building data-centric, analytical
web applications with interactive visualizations. It is highly favored in business intelligence, scientific
computation, and enterprise reporting.

Core Functionalities

 Component-based UI: Reusable components rendered as [Link] behind the scenes.


 Plotly Graph Integration: Advanced charts, maps, 3D plots.
 Real-time UI Updates: Callback-driven, interactive user inputs.
 Pure Python Development: No JS or CSS knowledge required.
 Production Deployment: Dash Enterprise for enterprise features.

Project Orientation

Dash is built for interactive dashboards, reporting apps, advanced analytics, data science portals, and
internal business tools.

Model Example
python

import dash
from dash import html

app = [Link](__name__)
[Link] = [Link](children=[
html.H1('Hello Dash!'),
[Link]('Dash: A web application framework for Python.')
])

if __name__ == '__main__':
app.run_server(debug=True)

Advantages

Dash comes equipped with easy linking of interactive charts and UI widgets, facilitating rapid analytical
app development. No need for bespoke web skills—ideal for data-driven organizations. Dash’s Plotly
underpinnings give it unmatched data vis and real-time updates38.

Limitations

Limited UI customization compared to general web frameworks. Advanced layouts or navigation can be
complex, and learning Dash’s callback architecture takes effort. For projects with no analytical component, it’s
overkill.

Guidance for Learners

Data analysts, scientists, and business-savvy developers should use Dash for client dashboards, academic
presentations, NGO data portals, and any scenario where visual analytics are paramount. For mobile-first
or generic web products, use another framework.

FastAPI
Purpose

FastAPI is a modern, high-performance web framework purpose-built for creating APIs with Python 3.8+. It
was designed to leverage asynchronous programming and type hints for developer productivity, speed, and
automatic OpenAPI (“Swagger”) documentation.

Core Functionalities

 Async/await Support: First-class asynchronous handling, perfect for high-concurrency APIs.


 Type Hints: Enforces request parameter/data typing, leading to auto docs and safer code.
 Automatic API Documentation: Generates interactive Swagger UI and Redoc endpoints.
 Data Validation: Built on Pydantic for robust, schema-based validation.
 ASGI Compliant: Supports advanced protocols (WebSockets, HTTP2).

Project Orientation

FastAPI targets modern RESTful APIs, high-throughput AI/ML model deployment, streaming platforms,
and any application where real-time, concurrent request handling is critical. It is rising quickly as a
favorite for both web developers and data scientists.
Model Example

from fastapi import FastAPI

app = FastAPI()

@[Link]("/")
async def read_root():
return {"Hello": "FastAPI"}

Run the server via uvicorn main:app --reload on [Link] Interactive API documentation
is available at /docs.

Advantages

FastAPI combines performance and developer experience. Its async model enables thousands of concurrent
connections, ideal for financial-tech, IoT, or AI streaming. Built-in data validation reduces runtime bugs, while
OpenAPI docs improve collaboration and client-code generation. It has rapidly grown a vibrant community and
ecosystem, with strong learning materials.

Limitations

Working with async code - especially for those coming from strictly synchronous environments - introduces a
steep learning curve: debugging, testing, and concurrency control are more complex than with traditional
frameworks. FastAPI intentionally omits built-in admin tools, authentication, or ORM layers, requiring
additional frameworks or custom code for such features.

Guidance for Learners

FastAPI is exceptional for learners targeting modern API development, high-concurrency systems, or
AI/ML deployment within the tech scene—for example, in fintech firms, edtech APIs, or government data
innovation. Choose FastAPI for:

 High-performance RESTful/GraphQL APIs


 ML model serving on the web
 Projects using Python async for real-time tasks (e.g., chat, notifications)
 Building backend services that will later scale to support thousands of simultaneous clients

Be prepared to learn about asynchronous Python, Pydantic, and relevant deployment techniques.

Pyramid
Purpose

Pyramid is a flexible, “minimal-to-complex” web framework optimizing for developer choice, scalability, and
the freedom to use only those features you need. Known for its “start small, finish big” motto, it enables quick
one-file apps or expansive, enterprise-grade deployments, bridging the gap between microframeworks and full-
stack solutions.
Core Functionalities

 URL Dispatch (Routing): Flexible mapping of URLs to views.


 Optional ORM, Templating: Developers choose databases and templates (SQLAlchemy, Jinja2, Mako).
 Add-ons and Plugins: Modular, rapidly expanding ecosystem for plugins and advanced features.
 Security: Built-in support for authentication, authorization, session handling, and CSRF protection.
 MVC Pattern: Clean separation of logic, interface, and data.

Project Orientation

Pyramid fits a broad range of applications—from basic, single-file sites to modular, complex business
systems. It is especially suited to projects where requirements will change and scale, or where integrations with
multiple technologies are vital.

Model Example

from wsgiref.simple_server import make_server


from [Link] import Configurator
from [Link] import Response

def hello_world(request):
return Response('Hello, Pyramid!')

if __name__ == '__main__':
with Configurator() as config:
config.add_route('hello', '/')
config.add_view(hello_world, route_name='hello')
app = config.make_wsgi_app()
server = make_server('[Link]', 6543, app)
server.serve_forever()

Advantages

Pyramid’s prime virtue is adaptability. Beginners or teams can incrementally add complexity as the project
grows—starting with only routing, then layering on templating, ORM, authentication, and deployed
components as needs change. The quality of documentation and cross-platform support are strong attractions.
Pyramid is used by global names such as Mozilla and SurveyMonkey, reflecting its robustness.

Limitations

Compared to Django or Flask, Pyramid’s documentation is less widely referenced and its developer community
is smaller, meaning less third-party tutorials, templates, or out-of-the-box integrations for learners. Setting up
add-ons may require more time and understanding of configuration systems.

Guidance for Learners

Those aiming to build modular, long-lifetime systems or start minimal with room to expand will benefit
from Pyramid. Projects that outgrow Flask can migrate to Pyramid for advanced security, scaling, or
architecture. Great for:

 Organizations expecting rapid project evolution


 Tech startups aiming for something “just enough” at first, but ready for more
 Cases where tight integration with legacy or third-party technologies is needed
Beginners may find Django or Flask easier for their first projects.

Tornado
Purpose

Tornado is a web framework and asynchronous networking library for Python, specialized in non-blocking
network I/O and high concurrency. It is ideal for projects requiring long-lived connections, such as chat servers,
IoT telemetry ingestion, or WebSocket-powered live dashboards, and is not bound by Python’s traditional
WSGI limitations.

Core Functionalities

 Native Async/Non-blocking I/O: Handles tens of thousands of concurrent connections.


 Web Server: Standalone HTTP server, not just a framework.
 WebSockets, Long Polling: Used for real-time streaming and bidirectional communication.
 Simple Routing and Handlers: Clear, handler-based architecture.
 Integration with Asyncio: Since version 5.0, shares event loop with asyncio for modern concurrency.

Project Orientation

Tornado is well-suited to real-time web services, chat platforms, streaming APIs, high-concurrency IoT
devices, and low-latency fintech or social apps, especially when custom protocols or persistent connections
are required.

Model Example

import [Link]
import [Link]

class MainHandler([Link]):
def get(self):
[Link]("Hello, Tornado!")

def make_app():
return [Link]([
(r"/", MainHandler),
])

if __name__ == "__main__":
app = make_app()
[Link](8888)
[Link]().start()

Advantages

Tornado’s non-blocking design makes it supremely scalable for concurrent workloads. It is one of the few
frameworks that can easily serve real-time web apps and protocols like WebSockets at scale without relying on
additional reverse proxies or asynchronous servers. It is lightweight at its core and is friendly to custom
extensions—useful for Kenya’s growing tech scenes in finance and telco where real-time is a must.
Limitations

Its programming model requires a solid grasp of asynchronous event loops and non-blocking paradigms, which
can be confusing for those used to synchronous frameworks. Not the best fit for standard CRUD apps or when
rich, full-feature features (ORM, admin, auth) are expected. The ecosystem for “classic” web features is
relatively small.

Guidance for Learners

If your project involves live chat, live sports, betting platforms, IoT devices, or interactive fintech
dashboards, Tornado may be ideal. However, general web learners may find Flask or Django easier, and only
“graduate” to Tornado once comfortable with Python’s async/await style and real-time networking.

Bottle
Purpose

Bottle is a compact, minimalistic Python web framework distributed as a single file, with no dependencies other
than the standard library. It is best viewed as a simplified teaching and prototyping tool, as well as a workhorse
in resource-constrained or embedded environments.

Core Functionalities

 Simple Routing: Maps request paths to functions via decorators.


 Built-in Template Engine: Ships with a lightweight, Pythonic template system.
 No Major Dependencies: Operates with only Python standard modules.
 Convenience Utilities: Handles form data, cookies, file uploads, headers, and more.
 Built-in Development Server: Out-of-the-box HTTP development server.

Project Orientation

Bottle is typically used for small web apps and services, rapid prototyping, embedded web application
teaching, and IoT device UIs. Its lack of architectural or configuration complexity makes it perfect for short,
educational code examples.

Model Example

from bottle import route, run, template

@route('/hello/<name>')
def index(name):
return template('<b>Hello {{name}}</b>!', name=name)

run(host='localhost', port=8080)

Advantages

Bottle offers supreme simplicity and zero friction. Learning core web concepts (routing, HTTP
requests/responses) becomes trivial. Its single-file distribution is perfect for scripting, small demos, or rapid
deployment in environments with dependency constraints—such as Raspberry Pi hardware labs, schools, and
prototyping workshops.

Limitations

The micro core delivers only essentials. There’s no ORM, authentication, forms, scaffolding, or advanced
middleware support, meaning everything must be built or integrated by hand. For anything larger than small
tools or teaching apps, scaling and maintainability become a challenge.

Guidance for Learners

Bottle is ideal for education, IoT, and resource-constrained environments common in local schools and
workshops. Use it to:

 Teach core web concepts in classrooms


 Deploy simple control panels for lab hardware or IoT
 Build text or file upload forms for small utilities

Switch to Flask, FastAPI, or Django for anything beyond prototyping or teaching.

CherryPy
Purpose

CherryPy is an object-oriented, minimalist web framework for Python designed around ordinary Python
classes and methods. With a built-in multi-threaded web server and a focus on “pythonicity,” it makes database-
driven and modular web development possible with relatively little boilerplate.

Core Functionalities

 Object-Oriented URL Handling: Maps URLs to methods by default.


 Built-in Web Server: HTTP/1.1-compliant, WSGI-compatible.
 Plugin Mechanism: Easily extend the framework’s core capabilities.
 Powerful Configuration System: Extensive, per-environment config for tuning.
 Session, Caching, Auth, Static Serving: Bundled support for key web features.

Project Orientation

CherryPy fits database-backed web services, internal business tools, educational OOP web development
projects, and as a core for custom web servers. Its design philosophy emphasizes modifiability—good for
educators and tinkerers.

Model Example

import cherrypy

class HelloWorld(object):
@[Link]
def index(self):
return "Hello World!"
if __name__ == '__main__':
[Link](HelloWorld())

Advantages

CherryPy’s OOP approach is uniquely Pythonic. It allows developers to reuse code, refactor, and compose
complex applications with fewer lines, and the built-in web server simplifies deployment. It is especially well-
suited to situations where in-depth knowledge of Python class design and web integration is beneficial.

Limitations

A steeper learning curve—especially for those with no prior exposure to object-oriented patterns. It is relatively
less popular these days, leading to limited third-party resources and fewer recent plugins. Not much emphasis
on “modern” web features like async or auto-generated docs.

Guidance for Learners

Consider CherryPy for teaching object-oriented web development, small to mid-size database apps, and
projects requiring deep customization. Its clarity helps bridge the gap from scripting to OOP, though for large
commercial projects, Django or Flask are easier to champion.

Falcon
Purpose

Falcon is a lightweight, high-performance web framework designed for rapid building of RESTful APIs and
microservices, focusing on speed, reliability, and correctness at scale. It minimizes framework “magic” and
promotes idiomatic, maintainable Python.

Core Functionalities

 Minimal Core: Keeps abstractions thin for speed and clarity.


 REST Resource–Based Routing: Explicit on_ HTTP method handling.
 ASGI/WSGI Compatibility: Runs with modern servers for both sync and async needs.
 Middleware Support: Centralizes request/response manipulation.
 Strict HTTP Compliance: Models error handling and protocol behaviors closely after relevant RFCs.

Project Orientation

Falcon is meant for mission-critical APIs, scalable backend microservices, cloud API gateways, and
projects where raw performance and predictable latency are vital.

Model Example

import falcon

class HelloWorldResource:
def on_get(self, req, resp):
[Link] = falcon.HTTP_200
[Link] = "Hello, Falcon World!"

app = [Link]()
app.add_route('/hello', HelloWorldResource())

Serve using gunicorn app:app or waitress for WSGI.

Advantages

Falcon offers best-in-class API performance and code clarity. By focusing on HTTP first principles and
avoiding “auto” behaviors, it is easy to reason about and debug even in very large deployments. Companies like
PayPal and OpenStack rely on Falcon for their critical services.

Limitations

There is little scaffolding—even basic features (templates, ORM, auth) must be handled externally. Not suitable
for beginners or general web apps; it’s built for APIs and expects developers to manage a lot of config and
architecture.

Guidance for Learners

Perfect for API specialists and those building microservice meshes, fintech endpoints, or real-time data
ingestion layers requiring minimal latency and maximum throughput. Avoid as a “first” web framework,
but study it as you move into enterprise, API-first, or cloud native architectures.

Sanic
Purpose

Sanic is an asynchronous Python 3.6+ web framework crafted for speed, offering lightning-fast HTTP and
WebSocket servers out of the box. It leverages Python’s async features and the uvloop event loop for superior
concurrency.

Core Functionalities

 First-class Async/await: All request handlers are native coroutines.


 WebSocket Support: Easy real-time communication.
 Middleware, Blueprints: Modular architecture, reusable code blocks.
 Flexible Routing: Supports route groups, parameter parsing.
 Production-ready Server: Bundled, no separate deployment tools needed.

Project Orientation

Sanic is well-suited for real-time web apps, chat services, microservices, and any workload needing
extreme concurrency/performance, especially in start-ups and fintech.

Model Example
from sanic import Sanic
from [Link] import text

app = Sanic("HelloSanicApp")

@[Link]("/")
async def hello_world(request):
return text("Hello, world.")

if __name__ == "__main__":
[Link](host="[Link]", port=8000)

Advantages

Sanic’s true async core is built for throughput. It’s the best way for Pythonistas to match [Link]-style real-
time web servers, and its bundled server means easy deployment. Its documentation and community have
matured, and it’s increasingly trusted for low-latency, event-driven architectures.

Limitations

Smaller ecosystem than Flask or Django. Complex apps demand careful management of async patterns and
concurrency. Async debugging is more complex, and integration with frameworks expecting WSGI needs care.

Guidance for Learners

Sanic is great for innovators, real-time notification systems, Kenyan fintech APIs needing scale, or any
deep-tech firm seeking the best in Python async concurrency. Best to tackle after learning Flask or Django,
and after mastering async Python.

Web2py
Purpose

Web2py is an open-source, full-stack framework for agile, secure, database-driven web application
development. Emphasizing simplicity and “out-of-the-box” productivity, it uses a web-based IDE and
prioritizes security and rapid prototyping.

Core Functionalities

 Integrated Web IDE: Build, edit, deploy apps from the browser.
 Automatic Admin Interface: CRUD admin dashboards for models.
 MVC Pattern: Clean separation for manageable projects.
 Rich Database Abstraction Layer (DAL): Cross-database queries without SQL.
 Integrated Security: Auto input validation, XSS, CSRF protections.

Project Orientation

Web2py is typically used for educational platforms, internal tools, rapid admin-driven database
applications, and small-to-midsize business platforms.
Model Example

# Typical web2py controller (python file in controllers directory)


def hello():
return "Hello, web2py World!"

Advantages

Web2py is ideal for education, prototyping, and apps needing robust security from day one. Its minimal
configuration, cross-platform nature, and clear embrace of the MVC pattern make it easy for beginners.

Limitations

Web2py is less modern than Django or FastAPI—async support is limited, and its plugin ecosystem is aging. It
is not recommended for new, large-scale production projects; maintainers now recommend py4web for new
work.

Guidance for Learners

Web2py’s ease of use makes it perfect for educational settings, hackathons, and prototypes or “safe”
admin dashboards that won’t need to scale out. For large, public systems, prefer Django or FastAPI.

TurboGears
Purpose

TurboGears is an extensible Python web framework that can operate either as a microframework for small
applications or scale up to a full-stack solution for complex systems. It bridges the flexibility of Flask with the
power of Django, aiming to “scale with you.”

Core Functionalities

 Hybrid Micro-to-Full Stack Model: Start small or large, scale up as needed.


 ObjectDispatch Paradigm: Simple URL/view mapping.
 Full ORM Support: Pluggable backends (SQLAlchemy, MongoDB, etc.).
 Widget System: AJAX, templates, and more for rich UIs.
 Scaffolding & Rapid Prototyping: Command-line code generation.

Project Orientation

TurboGears works for start-ups, classroom projects, or SaaS companies expecting their stacks to evolve
from MVP prototypes to enterprise platforms.

Model Example
from wsgiref.simple_server import make_server
from tg import MinimalApplicationConfigurator, expose, TGController

class RootController(TGController):
@expose(content_type="text/plain")
def index(self):
return 'Hello World'

config = MinimalApplicationConfigurator()
config.update_blueprint({'root_controller': RootController()})

httpd = make_server('', 8080, config.make_wsgi_app())


httpd.serve_forever()
Advantages

TurboGears allows flexibility and smooth scaling. Use it as Flask at first, then add admin, ORM, migrations,
etc. as your company or project grows. Its toolchain helps educational settings teach everything from “hello
world” to enterprise complexity in one stack.

Limitations

Somewhat less popular and documented than Django or Flask; the learning curve can be steeper, and the
community is smaller, which may present challenges for new developers.

Guidance for Learners

TurboGears is great for computer science curricula, growing SaaS businesses, startups, or anyone
expecting their web app’s needs to change significantly over time. For a more straightforward entry, begin
with Flask before scaling up.

Panel
Purpose

Panel is an open-source dashboarding and data exploration framework that helps build complex analytics
applications and dashboards in pure Python, often serving as a bridge between Jupyter notebooks and
deployable web solutions.

Core Functionalities

 Rich Widgets and Layouts: Advanced dashboarding (sliders, selectors, pipelines).


 Interoperability: Integrates with pandas, numpy, matplotlib, Holoviews, and more.
 Interactive Jupyter/Notebook Support: Write dashboards as notebooks.
 Flexible Deployment: Can serve as static HTML, web server (via Tornado, Flask, or FastAPI), or notebook viewer.
 Reactive APIs: Both high-level and low-level APIs for interactivity.

Project Orientation

Panel is a strong fit for advanced dashboards, research data-wrangling tools, Jupyter extension apps, and
enterprise analytics requiring powerful visualization.

Model Example
import panel as pn

def say_hello(name):
return f"Hello, {name}!"

[Link]()
[Link](say_hello, name='World').servable()

Advantages

Panel is the “Swiss army knife” for data science dashboards and interactive exploration. Its PyData
ecosystem compatibility makes it especially valuable for researchers and educators collaborating on real-world
datasets and analyses in Python, with minimal web-dev overhead.

Limitations

Steep learning curve for beginners and more configuration required than Streamlit. Documentation, while
growing, is not as extensive as for Django or Dash.

Guidance for Learners

Panel is best for universities, analytics consulting teams, advanced scientific researchers, or anyone
needing robust data visualization and dashboarding tailored to unique workflows. For simpler or more
straightforward dashboards, prefer Streamlit or Dash.

Gradio
Purpose

Gradio is an innovative, open-source Python framework focused on building user-friendly, interactive web
interfaces for machine learning models, APIs, and functions with minimal effort.

Core Functionalities

 Drag-and-Drop ML Demos: UIs generated for Python functions with support for various input/output types.
 Multi-modal Components: Handle text, image, audio, video, and more.
 Shareable Links: Easy sharing of model demos and tools.
 Integration: Seamless with Hugging Face, TensorFlow, PyTorch.
 Customizable Layouts: Flexible interfaces for model comparisons, parameter testing.

Project Orientation

Targeted towards machine learning developers, researchers, teachers, or anyone keen on sharing,
demoing, or testing ML models interactively.

Model Example

import gradio as gr

def greet(name):
return "Hello " + name + "!"

demo = [Link](fn=greet, inputs="textbox", outputs="textbox")

if __name__ == "__main__":
demo. Launch()

Advantages

Gradio sets the standard for ML interactivity. It’s the quickest, easiest way to build public-facing demos,
classroom interactive experiments, or input-testing GUIs for models with zero web expertise required. Rapid
adoption in ML research communities attests to its value.

Limitations

Not suitable for general web or dashboard development. Limited for apps with extended navigation, persistent
storage, or complex authentication flows.

Guidance for Learners

Gradio is highly recommended for students, educators, and ML practitioners wanting to showcase or test
models locally or with peers. It’s perfect for hackathons, show-and-tell sessions, and open-data ML
collaborations.

July 2025 Cohort Recordings


Right Click on the Links Below to Open in a New Tab

Session 1

Session 2

Session 3

Catchup Session
Project Ideas
You've reached The Grand Finale🏆! This is the ultimate test of your coding journey—a chance to bring all
your hard work, creativity, and skills together. Prepare to leave your mark as we celebrate the incredible
culmination of your bootcamp adventure! 🎉

As a beginner or an intermediate developer, it's okay to admit it might be hard to have a project in mind to work
on. Here are some of the projects that you can work on. These projects are categorized into sectors and levels of
complexity.

Let's focus on SDG-Based Project Development Guidelines

SDG 1: No Poverty
Project Ideas:

 Mobile app for financial literacy for low-income families


 AI-powered budgeting app for poverty alleviation
 Crowdfunding platform for poverty relief
 Microloan platform for small businesses
 Geospatial analysis tool to identify poverty-stricken areas

Guidelines:

 Build apps that teach money skills in simple language so families can budget and save.
 Use AI to create personalized budgeting tips that match the income and spending habits of poor
households.
 Develop crowdfunding platforms where communities can directly support people in need.
 Provide microloan platforms with low-interest loans to small businesses to promote self-reliance.
 Use maps and data analysis to pinpoint areas with the highest poverty and guide support.

SDG 2: Zero Hunger


Project Ideas:

 Food waste tracking app


 Supply chain optimization for food distribution
 AI-powered nutrition recommendation system
 Mobile platform for food donation matching
 Agriculture data platform for farmers

Guidelines:

 Create apps that help households and businesses track and reduce food waste.
 Build smarter supply chains so food moves faster from farms to tables without loss.
 Use AI to provide affordable meal and diet suggestions to improve nutrition.
 Develop platforms where restaurants and stores can donate surplus food directly to people in need.
 Support farmers with data platforms that give real-time updates on soil, weather, and crops.
SDG 3: Good Health and Well-Being
Project Ideas:

 Health monitoring app for chronic conditions


 Telemedicine platform for rural areas
 AI-driven mental health chatbots
 Mobile app for vaccination tracking
 Wearable health device for real-time health data

Guidelines:

 Build apps that let patients monitor blood sugar, blood pressure, or other chronic conditions easily.
 Create telemedicine platforms so rural families can see doctors online without travel.
 Use AI chatbots to give friendly mental health support and check-ins.
 Design apps that track vaccinations for children and adults, with reminders.
 Develop wearables that provide real-time health data for quick response.

SDG 4: Quality Education


Project Ideas:

 E-learning platform for underprivileged children


 AI tutor for personalized learning experiences
 Mobile app for affordable educational resources
 Platform for skill development in underserved communities
 Virtual classroom for remote education

Guidelines:

 Create low-cost e-learning platforms so every child can learn from anywhere.
 Use AI tutors to provide step-by-step lessons tailored to each student’s pace.
 Build mobile apps that provide free or cheap books, notes, and resources.
 Develop skill-building platforms that train youth for jobs in demand.
 Set up virtual classrooms that make remote education interactive and accessible.

SDG 5: Gender Equality


Project Ideas:

 App for reporting gender-based violence


 Workplace equality analytics tool
 Mobile platform for empowering women entrepreneurs
 Online platform for gender-neutral career opportunities
 Data-driven tool for tracking gender equality progress in businesses
Guidelines:

 Build safe apps for anonymous reporting of gender-based violence.


 Create analytics tools for companies to track and improve gender balance.
 Provide platforms that connect women entrepreneurs to funding and mentorship.
 Develop career platforms that remove gender bias in job opportunities.
 Use data tools to help organizations measure and improve equality policies.

SDG 6: Clean Water and Sanitation


Project Ideas:

 Water usage tracking app


 Real-time water quality monitoring platform
 Mobile app for locating clean water sources
 Smart water management system for cities
 AI tool for predicting water shortages

Guidelines:

 Create apps that show households how much water they use daily.
 Build systems to test and monitor water quality instantly.
 Develop mobile apps that map the nearest clean water sources.
 Use sensors for smart city water management that reduce waste and leaks.
 Apply AI to predict droughts and water shortages early.

SDG 7: Affordable and Clean Energy


Project Ideas:

 Solar panel efficiency monitoring app


 Smart home energy management platform
 Renewable energy consumption tracking app
 AI-powered energy grid optimization system
 Decentralized renewable energy trading platform

Guidelines:

 Develop apps to show how much energy solar panels produce daily.
 Create smart home systems that turn off unused devices automatically.
 Provide apps that let households track and compare renewable energy use.
 Use AI to help energy providers balance supply and demand efficiently.
 Build trading platforms where communities can share and sell renewable energy locally.

SDG 8: Decent Work and Economic Growth


Project Ideas:

 Job matching platform using AI


 Freelancer platform for underserved communities
 Skill-building app for unemployed youth
 Crowdsourced work for economic empowerment
 AI-powered career guidance platform

Guidelines:

 Create AI-based platforms that match job seekers with the right opportunities quickly.
 Build freelancer platforms that connect marginalized communities with online work.
 Develop mobile apps for learning new skills and certifications to help unemployed youth.
 Launch crowdsourced work platforms where small tasks generate income for many.
 Provide AI career guidance tools that suggest career paths based on skills and interests.

SDG 9: Industry, Innovation, and Infrastructure


Project Ideas:

 Smart city infrastructure management system


 IoT-based supply chain optimization platform
 AI-driven manufacturing process improvement tool
 3D printing technology for affordable housing
 Sustainable construction materials marketplace

Guidelines:

 Build smart systems that monitor roads, transport, and city infrastructure in real time.
 Use IoT devices to track and improve supply chain efficiency.
 Apply AI to factories to reduce errors and boost productivity.
 Develop low-cost housing using 3D printing for fast and affordable homes.
 Create marketplaces for eco-friendly construction materials.

SDG 10: Reduced Inequalities


Project Ideas:

 Platform for accessible education for people with disabilities


 Crowdsourced community development app
 Mobile app for income disparity tracking
 Online platform for promoting inclusivity in the workplace
 Real-time resource distribution app for marginalized groups

Guidelines:
 Build platforms that offer adaptive learning tools for differently-abled learners.
 Create apps that let communities propose and vote on local development projects.
 Develop tools to track and report income gaps across regions.
 Provide online platforms for inclusive hiring and equal workplace opportunities.
 Design apps for instant delivery of food, shelter, or aid to those in need.

SDG 11: Sustainable Cities and Communities


Project Ideas:

 Smart public transportation system


 Mobile app for community engagement in urban planning
 Sustainable waste management app
 AI-powered pollution monitoring system
 Urban farming platform for city dwellers

Guidelines:

 Develop smart transport apps that optimize routes, reduce wait times, and lower emissions.
 Build platforms for citizens to share ideas and feedback on city planning.
 Create apps that help households and cities separate and manage waste better.
 Use AI to monitor and reduce air and noise pollution in cities.
 Provide platforms that teach and connect people to urban farming practices.

SDG 12: Responsible Consumption and Production


Project Ideas:

 Carbon footprint tracking app


 AI-powered waste sorting system
 Sustainable product marketplace
 Green supply chain management platform
 E-commerce platform for secondhand goods

Guidelines:

 Create apps that calculate the carbon impact of daily activities.


 Develop AI systems to auto-sort waste into recyclable categories.
 Launch marketplaces for eco-friendly and ethically produced goods.
 Provide supply chain platforms that track sustainability in sourcing and production.
 Build e-commerce apps that promote reuse through secondhand buying and selling.

SDG 13: Climate Action


Project Ideas:

 Climate change data visualization platform


 App for sustainable lifestyle habits
 Real-time climate change monitoring platform
 Green energy consumption tracker
 AI-powered disaster preparedness tool

Guidelines:

 Build platforms that make climate data easy to read and understand for everyone.
 Create apps that encourage eco-friendly habits like recycling, biking, or saving energy.
 Monitor climate indicators (temperature, storms, rainfall) in real time.
 Provide trackers for households and businesses to measure and reduce energy use.
 Use AI to predict disasters early and guide response plans.

SDG 14: Life Below Water


Project Ideas:

 Marine pollution tracking platform


 Real-time ocean temperature monitoring system
 Platform for sustainable fishing practices
 AI-based marine conservation tool
 Crowdsourced ocean cleanup app

Guidelines:

 Create tools to track and report marine pollution hotspots.


 Build systems for monitoring ocean temperatures and patterns.
 Provide apps that teach and promote safe fishing practices.
 Use AI for detecting threats to marine life and suggesting interventions.
 Develop apps that mobilize volunteers for beach and ocean cleanups.

SDG 15: Life on Land


Project Ideas:

 Wildlife monitoring app using drones


 AI-powered deforestation detection system
 Sustainable land management platform
 Conservation efforts tracking app
 Forest fire prediction and prevention tool

Guidelines:
 Deploy drones to monitor and protect endangered species.
 Use AI to spot deforestation early through satellite images.
 Build platforms for sustainable farming and land use practices.
 Create apps that track and showcase ongoing conservation projects.
 Develop tools for predicting and preventing wildfires in forests.

SDG 16: Peace, Justice and Strong Institutions


Project Ideas:

 Legal aid platform for marginalized communities


 Transparency tracking platform for government spending
 Crowdsourced human rights advocacy app
 Online platform for promoting social justice
 AI-driven tool for monitoring peacekeeping efforts

Guidelines:

 Build platforms that connect vulnerable people with free or affordable legal support.
 Create transparency apps to show how public funds are being spent.
 Develop apps where communities can report human rights abuses anonymously.
 Provide online spaces that educate and advocate for justice and equality.
 Use AI to monitor and improve peacekeeping operations worldwide.

SDG 17: Partnerships to Achieve the Goal


Project Ideas:

 Collaborative platform for global partnerships


 Crowdfunding platform for sustainable development projects
 Data-sharing platform for NGOs
 AI-powered tool for monitoring SDG progress
 Global resource-sharing platform for development projects

Guidelines:

 Build collaborative platforms that connect NGOs, governments, and businesses to work together.
 Create crowdfunding platforms that channel funds into sustainable projects globally.
 Provide secure data-sharing spaces where NGOs can collaborate transparently.
 Use AI to measure and report progress on SDG targets in real time.
 Develop platforms for sharing resources, skills, and technology across borders.

July 2025 Cohort Final Project Submission Form

[Link]

You might also like