Python Programming Notes
Beginner to Intermediate Guide – 16 Chapters
Prepared for students learning programming basics with examples.
Chapter 1 – Introduction to Python
Topics Covered:
• What is Python
• Features of Python
• Applications of Python
• Running your first program
Example Code:
print("Hello, World!")
Chapter 2 – Installation and Setup
Topics Covered:
• Downloading Python
• Installing Python
• Using Python IDLE
• Running Python from terminal
Example Code:
print("Python installed successfully!")
Chapter 3 – Variables and Data Types
Topics Covered:
• Variables
• Integer
• Float
• String
• Boolean
Example Code:
name = "Aditya"
age = 16
marks = 85.5
print(name, age, marks)
Chapter 4 – Operators
Topics Covered:
• Arithmetic Operators
• Comparison Operators
• Logical Operators
• Assignment Operators
Example Code:
a = 10
b = 5
print(a + b)
print(a > b)
Chapter 5 – Input and Output
Topics Covered:
• Using input()
• Output formatting
• Type conversion
Example Code:
name = input("Enter your name: ")
print("Hello", name)
Chapter 6 – Conditional Statements
Topics Covered:
• if statement
• if-else statement
• if-elif-else statement
Example Code:
age = 18
if age >= 18:
print("You can vote")
else:
print("You cannot vote")
Chapter 7 – Loops
Topics Covered:
• for loop
• while loop
• break statement
• continue statement
Example Code:
for i in range(5):
print(i)
Chapter 8 – Lists
Topics Covered:
• Creating lists
• Accessing elements
• List methods
Example Code:
fruits = ["apple","banana","mango"]
print(fruits[0])
Chapter 9 – Tuples
Topics Covered:
• Creating tuples
• Tuple indexing
• Difference between list and tuple
Example Code:
numbers = (1,2,3,4)
print(numbers[1])
Chapter 10 – Dictionaries
Topics Covered:
• Key-value pairs
• Accessing dictionary values
• Dictionary methods
Example Code:
student = {"name":"Aditya","age":16}
print(student["name"])
Chapter 11 – Functions
Topics Covered:
• Defining functions
• Parameters
• Return values
Example Code:
def greet(name):
print("Hello", name)
greet("Aditya")
Chapter 12 – Modules
Topics Covered:
• Importing modules
• Using math module
• Using random module
Example Code:
import math
print([Link](16))
Chapter 13 – File Handling
Topics Covered:
• Opening files
• Reading files
• Writing files
Example Code:
file = open("[Link]","w")
[Link]("Hello Python")
[Link]()
Chapter 14 – Object Oriented Programming
Topics Covered:
• Classes
• Objects
• Methods
Example Code:
class Student:
def __init__(self,name):
[Link] = name
s1 = Student("Aditya")
print([Link])
Chapter 15 – Error Handling
Topics Covered:
• try statement
• except statement
• finally statement
Example Code:
try:
x = int(input("Enter number: "))
except:
print("Invalid input")
Chapter 16 – Simple Projects
Topics Covered:
• Calculator program
• Number guessing idea
• Basic practice project
Example Code:
a = int(input("Enter first number: "))
b = int(input("Enter second number: "))
print("Sum =", a + b)