Complete Python Course for
[Link] Students
Basics + Intermediate | Visual
Learning with Examples & Exercises
Module 1: Introduction to Python
• What is Python?
• Features & Applications
• First Program: Hello World
•
💻 Example:
print('Hello, World!')
•
🧠 Exercise: Install Python and run your first program.
Module 2: Variables, Data Types &
Operators
• Numbers, Strings, Lists, Tuples, Sets, Dictionaries
• Type Casting and Operators
•
💻 Example:
a, b = 10, 20
print(a + b)
•
🧠 Exercise: Create a program that swaps two variables without a temp variable.
Module 3: Control Flow
• if-elif-else
• for and while loops
• break, continue, pass
•
💻 Example:
for i in range(1,6):
if i == 3: continue
print(i)
•
🧠 Exercise: Write a loop to print all even numbers from 1 to 50.
Module 4: Functions & Scope
• Function definition, parameters, return
• Lambda functions and scope
•
💻 Example:
def square(x):
return x*x
print(square(5))
•
🧠 Exercise: Create a function that checks whether a number is prime.
Module 5: File Handling
• Opening, Reading, Writing files
• Using 'with open()' safely
•
💻 Example:
with open('[Link]','w') as f:
[Link]('Python File Handling!')
•
🧠 Exercise: Write a program to count the number of lines in a file.
Module 6: Exception Handling
• Try, Except, Else, Finally
• Raise exceptions, custom exceptions
•
💻 Example:
try:
x = int(input('Enter a number: '))
except ValueError:
print('Invalid input!')
•
🧠 Exercise: Create a calculator that handles invalid inputs gracefully.
Module 7: Object-Oriented
Programming
• Classes, Objects, Constructors
• Inheritance, Polymorphism, Encapsulation
•
💻 Example:
class Student:
def __init__(self,name,marks):
[Link]=name; [Link]=marks
def display(self):
print([Link], [Link])
•
🧠 Exercise: Create a class `BankAccount` with deposit and withdraw methods.
Module 8: Modules & Packages
• Importing modules
• Creating your own module
•
💻 Example:
import math
print([Link](5))
•
🧠 Exercise: Create a module named 'calc' with add and multiply functions.
Module 9: Regular Expressions
• Using re module
• Pattern matching and validation
•
💻 Example:
import re
pattern = r'[A-Za-z0-9._%+-]+@[A-Za-z.-]+\.[A-Za-z]{2,}'
print(bool([Link](pattern,'test@[Link]')))
•
🧠 Exercise: Validate if an input string is a valid phone number.
Module 10: Python Libraries
Overview
• NumPy, Pandas, Matplotlib
•
💻 Example:
import numpy as np
import [Link] as plt
x=[Link](5); y=x**2
[Link](x,y); [Link]()
•
🧠 Exercise: Use Pandas to read a CSV file and display top 5 rows.
Module 11: Mini Project - Student
Management System
• Add, Delete, View student records
• File I/O and Exception handling
•
💻 Example:
students=[]
while True:
name=input('Enter name: ')
if name=='': break
[Link](name)
print(students)
•
🧠 Exercise: Implement data saving in a CSV file using the csv module.
Module 12: Quiz & Summary
• 10 Objective Questions
• Recap of major Python concepts
•
🧠 Exercise: Revise topics and attempt 10 practice MCQs.