Programming · Daily chapter
🐍 Python
20 chapters · Notes, runnable code and practice
Day
01
01
Introduction to Python
What Python is, why it is popular, how the interpreter works, and how to run your first Python program.
Day
02
02
Variables in Python
Create and use variables in Python. Dynamic typing, common types and assignment patterns.
Day
03
03
Identifiers & Keywords in Python
Rules for naming identifiers, the list of Python keywords, and PEP 8 naming conventions.
Day
04
04
Data Types in Python
Numbers, strings, booleans, lists, tuples, dicts, sets — Python's built-in types and how to convert between them.
Day
05
05
Operators in Python
Arithmetic, comparison, logical, assignment, identity and membership operators.
Day
06
06
Conditional Statements in Python
if, elif, else, ternary expression and match-case in Python.
Day
07
07
Loops in Python
for and while loops, range(), break, continue, else on loops and enumerate.
Day
08
08
Lists in Python
Create, index, slice and mutate lists. Common list methods and pitfalls.
Day
09
09
Functions in Python
Define, call, return values, use default and keyword arguments, and lambdas.
Day
10
10
Class & Object in Python
Define classes, create objects, use __init__, self and instance methods — the entry to OOP in Python.
Day
11
11
Strings in Python
Index, slice and loop over strings, use the most useful string methods, and format output neatly with f-strings.
Day
12
12
Tuples in Python
Create tuples, use them like read-only lists, pack and unpack values, and know when a tuple is a better choice than a list.
Day
13
13
Dictionaries in Python
Store data as key–value pairs, look values up by key, add, update and delete entries, and loop over a dictionary.
Day
14
14
Sets in Python
Store unique items with sets, remove duplicates in one step, and combine groups with union, intersection and difference.
Day
15
15
Modules and Packages in Python
Reuse code with import, use the math, random and statistics modules, and write your own module and package.
Day
16
16
Exception Handling in Python
Catch runtime errors with try and except, use else and finally, raise your own exceptions, and recognise Python's common built-in exceptions.
Day
17
17
Text File Handling in Python
Open, write, read and append text files in Python, close them safely with with, and move around a file using seek() and tell().
Day
18
18
Binary and CSV Files in Python
Save Python objects to binary files with pickle, search and update records, and read and write spreadsheet-style CSV files with the csv module.
Day
19
19
Stack in Python (Using a List)
Build a stack (last in, first out) with a Python list: push, pop, peek and isEmpty, overflow and underflow, and a complete menu-driven program.
Day
20
20
Inheritance in Python
Reuse and extend classes with inheritance: single, multilevel and multiple inheritance, super(), and method overriding.