
Ready to take your Python skills to the next level?
Module 1: Object-Oriented Programming (OOP) Concepts
Duration: 3 weeks
Relevant Projects: Student Gradebook Manager (Python Project 4), Home Automation System (Robotics Project 3)
Overview:
Students learn core OOP principles (classes, objects, inheritance) to design reusable and modular code.
Objective:
-
Design classes. Create classes with attributes/methods (e.g., BankAccount).
-
Implement inheritance. Build hierarchical relationships between classes.
-
Apply encapsulation. Control access to data using private/public methods.
Sample code:
class BankAccount:
def __init__(self, owner, balance=0):
self.owner = owner
self.balance = balance
def deposit(self, amount):
if amount > 0:
self.balance += amount
print(f"Deposited ${amount}. New balance: ${self.balance}")
account = BankAccount("Alice")
account.deposit(100)
Module 3: Data Structures – Lists, Dictionaries, and Sets
Duration: 2 weeks
Relevant Projects: Personal Finance Tracker (Python Project 1), Flashcard Quiz App (Python Project 2)
Overview:
Deep dive into Python data structures for dynamic data management.
Objective:
-
Manage collections. Use dictionaries for key-value pairs (e.g., contacts).
-
Iterate efficiently. Loop through lists/dictionaries with clean syntax.
-
Apply sets. Handle unique items and perform set operations.
Sample code:
contacts = {}
def add_contact(name, number):
contacts[name] = number
Module 3: Data Structures – Lists, Dictionaries, and Sets
Duration: 2 weeks
Relevant Projects: Personal Finance Tracker (Python Project 1), Flashcard Quiz App (Python Project 2)
Overview:
Deep dive into Python data structures for dynamic data management.
Objective:
-
Manage collections. Use dictionaries for key-value pairs (e.g., contacts).
-
Iterate efficiently. Loop through lists/dictionaries with clean syntax.
-
Apply sets. Handle unique items and perform set operations.
Sample code:
contacts = {}
def add_contact(name, number):
contacts[name] = number
Python Project 2: Flashcard Quiz App
Duration: 3 weeks
Overview:
Students develop a flashcard application that lets them create and review quiz questions with answers.
Objective:
-
Build CRUD logic. Implement functionality to create, view, edit, and delete flashcards.
-
Interactive testing. Allow users to test themselves and receive feedback.
-
Optional GUI. Use Tkinter for a visual interface if desired.
Sample code:
flashcards = {"Capital of France": "Paris", "5 + 7": "12"}
for question, answer in flashcards.items():
user_answer = input(question + ": ")
if user_answer.lower() == answer.lower():
print("Correct!")
else:
print(f"Wrong! The correct answer is {answer}")
Python Project 4: Student Gradebook Manager
Duration: 3 weeks
Overview:
Create a system to manage students' grades across multiple subjects, allowing calculations of GPA and performance analysis.
Objective:
-
Use OOP. Design classes for students and grades.
-
Analyze data. Provide grade averages, highest/lowest subjects.
-
Enable storage. Save records in files or use a database (optional).
Sample code:
class Student:
def __init__(self, name):
self.name = name
self.grades = {}
def add_grade(self, subject, grade):
self.grades[subject] = grade
def average(self):
return sum(self.grades.values()) / len(self.grades)
s = Student("Alice")
s.add_grade("Math", 85)
s.add_grade("Science", 90)
print(s.average())
Robotics Project 1: Line Following Robot
Duration: 4 weeks
Overview:
Build a robot that uses IR sensors to detect and follow a black line.
Objective:
-
Use IR sensors. Calibrate and use IR sensors for line detection.
-
Motor control. Adjust direction and speed based on sensor input.
-
Conditional logic. Apply control statements to follow the line.
Sample code:
# Pseudo-code for motor control
if left_sensor and not right_sensor:
turn_left()
elif right_sensor and not left_sensor:
turn_right()
else:
go_straight()
Robotics Project 3: Home Automation System
Duration: 5 weeks
Overview:
A system to control home appliances (LEDs/relays) using a microcontroller and web interface.
Objective:
-
GPIO control. Use GPIO to control appliances.
-
Build UI. Use Flask or a simple web app.
-
Combine hardware & software. Integrate physical control and digital interface.
Sample code:
@app.route("/toggle")
def toggle():
GPIO.output(pin, not GPIO.input(pin))
return redirect("/")
Robotics Project 5: Voice-Controlled Robot
Duration: 6 weeks
Overview:
A robot that responds to voice commands such as “forward”, “stop”, “left”, and “right”.
Objective:
-
Speech recognition. Convert speech to text commands.
-
Interpret commands. Parse text to determine actions.
-
Robot control. Map voice input to movement.
Sample code:
import speech_recognition as sr
r = sr.Recognizer()
with sr.Microphone() as source:
print("Say a command: ")
audio = r.listen(source)
command = r.recognize_google(audio)
if "forward" in command:
move_forward()
Module 2: File Handling and Data Persistence
Duration: 2 weeks
Relevant Projects: Personal Finance Tracker (Python Project 1), Student Gradebook Manager (Python Project 4)
Overview:
Students read/write to files (text, CSV) and handle data persistence.
Objective:
-
Read/write files. Use open(), with blocks for file operations.
-
Error handling. Manage exceptions (e.g., FileNotFoundError).
-
Store structured data.Save/retrieve data in CSV or JSON formats.
Sample code:
def save_high_score(score, filename="scores.txt"):
try:
with open(filename, "a") as file:
file.write(f"{score}\n")
except Exception as e:
print(f"Error: {e}")
Module 4: Simple Game Development with Pygame
Duration: 2 weeks
Relevant Projects: Almost all 20 projects are using libraries
Overview:
Students will be introduced to basic game development using the Pygame library.
They will design a simple interactive game involving sprite movement, collision detection, and user input handling.
Objective:
-
Use Libraries
-
Understand CSV format basics
-
Encourage clean code and good variable naming
-
How to handle invalid or missing data.
Sample Code:
import pygame
pygame.init()
screen = pygame.display.set_mode((400, 300))
pygame.display.set_caption("Simple Game")
player = pygame.Rect(50, 50, 40, 40)
velocity = 5
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
keys = pygame.key.get_pressed()
if keys[pygame.K_LEFT]:
player.x -= velocity
if keys[pygame.K_RIGHT]:
player.x += velocity
screen.fill((255, 255, 255))
pygame.draw.rect(screen, (0, 0, 255), player)
pygame.display.update()
pygame.quit()
Python Project 1: Personal Finance Tracker
Duration: 3 weeks
Overview:
Students will build a personal finance tracker that allows users to input daily expenses, categorize them (e.g., food, travel, utilities), and view reports.
Objective:
-
Apply file handling. Students will write to and read from text/CSV files to store financial data.
-
Categorize data. Use dictionaries and lists to manage different expense categories.
-
Analyze spending. Implement basic functions to calculate totals and generate category-wise reports.
Sample code:
expenses = {}
def add_expense(category, amount):
if category in expenses:
expenses[category] += amount
else:
expenses[category] = amount
add_expense("Food", 20.5)
add_expense("Travel", 15.0)
add_expense("Food", 10.0)
for category, total in expenses.items():
print(f"{category}: ${total}")
Python Project 3: Simple LAN Chat App
Duration: 4 weeks
Overview:
Students will create a simple messaging system where two users can chat over a local network.
Objective:
-
Introduce networking. Use Python’s socket module to create server-client communication.
-
Implement threading. Allow asynchronous message exchange using threading.
-
Learn communication protocols. Understand basics of TCP/IP.
Sample code:
import socket
s = socket.socket()
s.bind(("", 12345))
s.listen(1)
c, addr = s.accept()
while True:
msg = c.recv(1024).decode()
print("Client:", msg)
Python Project 5: Weather Dashboard using API
Duration: 3 weeks
Overview:
A Python-based weather app that fetches and displays live weather info using a third-party API.
Objective:
-
Work with APIs. Use requests to fetch data from an online weather API.
-
Parse JSON. Read and format JSON data returned by the API.
-
Display data. Print or visualize the data. Optionally use a GUI.
Sample code:
import requests
city = input("Enter city: ")
response = requests.get(f"http://api.weatherapi.com/v1/current.json?key=API_KEY&q={city}")
data = response.json()
print(f"{city}: {data['current']['temp_c']}C")
Robotics Project 2: Smart Obstacle Avoider
Duration: 4 weeks
Overview:
Students build a robot that uses ultrasonic sensors to detect and avoid obstacles.
Objective:
-
Measure distances. Use ultrasonic sensors to calculate proximity.
-
Avoid obstacles. Stop or change direction on close detection.
-
Real-time control. Write responsive and efficient logic.
Sample code:
distance = measure_distance()
if distance < 10:
stop()
turn_right()
else:
move_forward()
Robotics Project 4: Face Detection Security System
Duration: 5 weeks
Overview:
Use a camera and Python to detect and log faces at the entrance.
Objective:
-
Use OpenCV. Capture and process real-time video.
-
Detect faces. Use Haar cascades to recognize faces.
-
Log activity. Save images of detected faces.