PYTHON COMPLETE GUIDE (FULL
BOOK)
1. Introduction to Python
Python is a high-level, easy-to-learn programming language used for Web Development, AI, ML,
Data Science, Automation, etc.
2. Print Statement
print("Hello World")
3. Variables & Data Types
name = "Fahid" age = 21 height = 5.8 is_active = True
4. User Input
name = input("Enter name: ") print("Welcome", name)
5. Operators
Arithmetic, Logical, Comparison, Assignment, Identity, Membership
6. If-Else
num = int(input("Enter: ")) if num > 0: print("Positive") else: print("Negative")
7. Loops (For / While)
for i in range(5): print(i) i = 1 while i <= 5: print(i) i += 1
8. Lists
fruits = ["apple", "banana", "mango"] [Link]("orange") print(fruits[1])
9. Tuples
t = (10, 20, 30) print(t[0])
10. Dictionaries
person = {"name": "Rahul", "age": 21} print(person["name"])
11. Functions
def add(a, b): return a + b print(add(10, 5))
12. File Handling
f = open("[Link]", "w") [Link]("Hello") [Link]() f = open("[Link]", "r") print([Link]())
13. Error Handling
try: print(10/0) except ZeroDivisionError: print("Cannot divide")
14. OOP - Class & Object
class Car: def __init__(self, brand): [Link] = brand c = Car("BMW") print([Link])
15. Modules
import math print([Link](25))
16. Python Projects
• Calculator • Password Generator • Contact Book • Student Grade System • To-Do App