Python Learning Journey – Quick Summary
@amitmund
June 17, 2026
- Heading
- Example
- Output
1. Statements, Comments & Indentation
Example
# This is a comment
if True:
print("Hello")
Output
Hello
2. Input & Output
Example
name = input("Enter name: ")
print(name)
Output
John
3. Data Types
Example
a = 10
b = 3.14
c = "Python"
print(type(a))
Output
<class 'int'>
4. Type Casting
Example
num = int("100")
print(num)
Output
100
5. String Operations
Example
text = "python"
print(text.upper())
Output
PYTHON
6. List
Example
numbers = [10, 20, 30]
print(numbers[1])
Output
20
7. Tuple
Example
data = (1, 2, 3)
print(data)
Output
(1, 2, 3)
8. Set
Example
items = {1, 1, 2, 3}
print(items)
Output
{1, 2, 3}
9. Dictionary
Example
student = {
"name": "John"
}
print(student["name"])
Output
John
10. Operators
Example
print(10 + 5)
Output
15
11. Variables & Scope
Example
x = 10
def show():
print(x)
show()
Output
10
12. Conditional Statements
Example
age = 18
if age >= 18:
print("Adult")
Output
Adult
13. While Loop
Example
i = 1
while i <= 3:
print(i)
i += 1
Output
1
2
3
14. For Loop
Example
for i in range(3):
print(i)
Output
0
1
2
15. break
Example
for i in range(5):
if i == 3:
break
print(i)
Output
0
1
2
16. continue
Example
for i in range(5):
if i == 2:
continue
print(i)
Output
0
1
3
4
17. assert
Example
x = 10
assert x > 5
print("Valid")
Output
Valid
18. Functions
Example
def add(a, b):
return a + b
print(add(2, 3))
Output
5
19. Recursion
Example
def factorial(n):
if n == 1:
return 1
return n * factorial(n - 1)
print(factorial(5))
Output
120
20. Lambda Function
Example
square = lambda x: x * x
print(square(4))
Output
16
21. List Comprehension
Example
numbers = [x for x in range(5)]
print(numbers)
Output
[0, 1, 2, 3, 4]
22. Modules
Example
import math
print(math.sqrt(25))
Output
5.0
23. Exception Handling
Example
try:
print(10 / 0)
except ZeroDivisionError:
print("Error")
Output
Error
24. Custom Exception
Example
class AgeError(Exception):
pass
raise AgeError("Invalid Age")
Output
AgeError: Invalid Age
25. File Handling
Example
with open("demo.txt", "w") as file:
file.write("Hello")
Output
Data written to file
26. Reading File
Example
with open("demo.txt", "r") as file:
print(file.read())
Output
Hello
27. Log File Offset Tracking
Example
file.seek(0, 2)
position = file.tell()
print(position)
Output
Current end position
28. Date
Example
from datetime import date
print(date.today())
Output
2025-07-27
29. Time
Example
from datetime import datetime
print(datetime.now().time())
Output
14:20:15
30. Datetime
Example
from datetime import datetime
print(datetime.now())
Output
2025-07-27 14:20:15
31. timedelta
Example
from datetime import timedelta
print(timedelta(days=5))
Output
5 days, 0:00:00
32. strftime()
Example
from datetime import datetime
print(
datetime.now().strftime("%d-%m-%Y")
)
Output
27-07-2025
33. strptime()
Example
from datetime import datetime
date_obj = datetime.strptime(
"27-07-2025",
"%d-%m-%Y"
)
print(date_obj)
Output
2025-07-27 00:00:00
34. Regular Expressions (Regex)
Example
import re
print(
re.findall(
r"\d+",
"Age 25"
)
)
Output
['25']
35. Django Overview
Example
# Django View
from django.http import HttpResponse
def home(request):
return HttpResponse("Hello Django")
Output
Hello Django
36. Django Project Creation
Example
django-admin startproject school
Output
Project Created
37. Run Django Server
Example
python manage.py runserver
Output
Starting development server...
38. Django App Creation
Example
python manage.py startapp students
Output
App Created
39. Django Model
Example
class Student(models.Model):
name = models.CharField(max_length=100)
Output
Database Table Created
40. Django Migration
Example
python manage.py makemigrations
python manage.py migrate
Output
Database Updated
41. Django View
Example
def home(request):
return HttpResponse("Welcome")
Output
Welcome
42. Django Template
Example
<h1>Hello User</h1>
Output
Displayed in Browser
43. Django Static Files
Example
{% load static %}
<link rel="stylesheet"
href="{% static 'css/style.css' %}">
Output
CSS Loaded
44. Django Forms
Example
class StudentForm(forms.Form):
name = forms.CharField()
Output
Form Rendered
45. Django Admin
Example
python manage.py createsuperuser
Output
Admin User Created
46. Django Deployment
Example
DEBUG = False
Output
Production Ready Configuration
One-Line Revision
Python Basics
↓
Data Types
↓
Operators
↓
Conditions
↓
Loops
↓
Functions
↓
Recursion
↓
Lambda
↓
Comprehensions
↓
Modules
↓
Exceptions
↓
File Handling
↓
Log Processing
↓
Date & Time
↓
Regex
↓
Django Basics
↓
Projects
↓
Apps
↓
Models
↓
Views
↓
Templates
↓
Static Files
↓
Forms
↓
Deployment