Duration: 4-6 weeks
Goal: Equip students with the foundational knowledge of Python programming and the skills to build basic-level projects.
Course Outline
Week 1: Introduction to Python
- What is Python? Why Python?
- Setting up Python and IDEs (e.g., PyCharm, VSCode, or Jupyter Notebook).
- First Program: "Hello, World!"
- Python Basics:
- Variables and Data Types
- Input/Output
- Comments and Code Structure
Hands-on Exercises:
- Write a program to calculate the area of a rectangle.
- Build a basic calculator for addition, subtraction, multiplication, and division.
Week 2: Control Structures and Loops
- Conditional Statements: if, else, elif
- Loops: for, while
- Break, Continue, and Pass statements
Hands-on Exercises:
- Write a program to check if a number is even or odd.
- Create a program to find the factorial of a number.
Week 3: Functions and Modules
- What are functions?
- Built-in vs. user-defined functions
- Arguments and Return values
- Importing and using modules (math, random)
Hands-on Exercises:
- Create a function to find the greatest common divisor (GCD) of two numbers.
- Write a program to generate a random password using the random module.
Week 4: Data Structures in Python
- Strings and String Manipulation
- Lists, Tuples, Sets, and Dictionaries
- Iterating through data structures
- Nested data structures
Hands-on Exercises:
- Write a program to count the occurrence of each word in a sentence.
- Create a program to manage a to-do list using a dictionary.
Week 5: File Handling and Exception Handling
- Reading from and writing to files
- Appending data to files
- Try, Except, Finally
Hands-on Exercises:
- Write a program to store student records in a file.
- Create a program to read a file and count the number of lines.
Beginner-Level Projects
Project 1: Student Marks Management System
Problem Statement: Build a program to manage and analyze student marks. The system should allow users to:
- Input student names and their marks
- Calculate the average marks
- Identify the highest and lowest marks
Tools: Python
Prerequisites: Variables, Lists, Loops, Functions
Project 2: Number Guessing Game
Problem Statement: Create a simple game where the computer generates a random number, and the user has to guess it within a limited number of attempts.
Features:
- Provide feedback like "too high" or "too low."
- Track the number of attempts.
Tools: Python
Prerequisites: Variables, Loops, Functions, Random Module
Project 3: Simple Expense Tracker
Problem Statement: Develop a program to track daily expenses. Users can add an expense, view all expenses, and calculate the total.
Tools: Python
Prerequisites: Lists, Dictionaries, Loops