🐍 Complete Course
Learn Python Programming
From Scratch
A complete Python programming guide covering fundamentals to advanced topics — with practical code examples at every step.
22
Lessons
50+
Code Examples
Free
Access
Lesson 01
Background of Python
Python is a high-level, interpreted, general-purpose programming language known for its simplicity and readability. It runs on every major platform and is used across web development, data science, AI, and more.
Python — Hello World
# Your very first Python program print("Hello, World!") print("Welcome to Python Programming!")
Output
Hello, World!\nWelcome to Python Programming!
Lesson 02
History of Python
Created by Guido van Rossum and first released in 1991. Python 3 is the present and future.
| Year | Version | Milestone |
|---|---|---|
| 1991 | Python 0.9.0 | First release |
| 2008 | Python 3.0 | Major redesign |
💡 Note: Always use Python 3.
Lesson 03
Features, Pros and Cons
- Interpreted & Dynamically typed
- Object-oriented & Extensive libraries
- Indentation-based syntax
Python — Dynamic Typing
x = 10 # int x = "Hello" # now a string
Lesson 04
Python Fundamentals
Variables
age = 25; name = "Alice"; gpa = 3.85 print(f"{name} is {age}")
Lesson 05
Python Operators
a,b = 15,4; print(a//b) # floor division 3
Lesson 06
Basic Structure
def main(): print("Structured") if __name__ == "__main__": main()
Lesson 07
Control Structure
if score >= 90: print("A")
Lesson 08
Sequence Control
Statements execute top to bottom by default.
Lesson 09
If Statements
age=20; status="Adult" if age>=18 else "Minor"
Lesson 10
Match Statement
match day: case 1: print("Monday")
Lesson 11
Loop Types
while n<3: print(n); n+=1
Lesson 12
For Loop Examples
for i in range(5): print(i)
Lesson 13
While Loop Examples
count = 0; while count < 3: print(count); count += 1
Lesson 14
Lists & Types
nums = [1,2,3]; nums.append(4); print(nums)
Lesson 15
String Functions
text = " Hello "; print(text.strip())
Lesson 16
Functions & Types
def add(a,b): return a+b
Lesson 17
Function Types
square = lambda x: x**2
Lesson 18
Recursion
def fact(n): return 1 if n<=1 else n*fact(n-1)
fact(5)=120
Lesson 19
Classes & Objects
class Student: def __init__(self,name): self.name=name
Lesson 20
List of Objects
students = [Student("Alice"), Student("Bob")]
Lesson 21
References & Memory
a = [1,2]; b = a; b.append(3); print(a) # [1,2,3]
Lesson 22
File Handling
with open("data.txt","w") as f: f.write("Python")
💡 Tip: Use ‘with’ for automatic file closing.