A structured repository for practicing Python programming, covering basic to advanced concepts with problem-solving exercises and mini projects.
A complete theory, internal working, advanced concepts, and professional engineering guide to the Python programming language.
- What is Python?
- Why Python?
- Programming Language Concepts
- Python Implementations
- Python Execution Model
- Interpreter vs Compiler
- CPython
- Bytecode
- Python Virtual Machine
- Source Code
- Syntax
- Statements
- Expressions
- Comments
- Indentation
- Keywords
- Identifiers
- Variables
- Constants
- Literals
- Dynamic Typing
- Strong Typing
- Duck Typing
- How Python Code Executes
- Parsing
- Abstract Syntax Tree (AST)
- Compilation
- Bytecode
- Python Virtual Machine
- Names and Objects
- Object Identity
- Object Type
- Object Value
- References
- Namespaces
- Scope
- LEGB Rule
- Call Stack
- Stack Frames
- Heap Memory
- Reference Counting
- Garbage Collection
- Object Interning
- Memory Management
- Everything Is an Object
- Object Identity
- Equality vs Identity
- Mutable Objects
- Immutable Objects
- Hashable Objects
- Unhashable Objects
id()type()isinstance()__class____dict____slots__- Dunder Methods
- Python Data Model
- Numbers
- Integers
- Floating-Point Numbers
- Complex Numbers
- Boolean
- Strings
- Lists
- Tuples
- Sets
- Frozensets
- Dictionaries
- Ranges
- Bytes
- Bytearray
- Memoryview
None- Type Conversion
- Truthiness
- Arithmetic Operators
- Comparison Operators
- Assignment Operators
- Logical Operators
- Identity Operators
- Membership Operators
- Bitwise Operators
- Operator Precedence
- Short-Circuit Evaluation
- Chained Comparisons
- Assignment Expressions
ifelifelse- Nested Conditions
whileforbreakcontinuepasselsewith Loopsmatch-case- Structural Pattern Matching
- Function Definition
- Function Calling
- Parameters
- Arguments
- Positional Arguments
- Keyword Arguments
- Default Arguments
- Positional-Only Arguments
- Keyword-Only Arguments
*args**kwargs- Return Values
- Multiple Return Values
- Scope
- Local Variables
- Global Variables
globalnonlocal- Recursion
- First-Class Functions
- Higher-Order Functions
- Function Annotations
- Docstrings
- Function Objects
- Lambda Functions
map()filter()reduce()zip()enumerate()sorted()any()all()- Functional Composition
- Pure Functions
- Side Effects
- List Comprehension
- Set Comprehension
- Dictionary Comprehension
- Generator Expressions
- Nested Comprehensions
- Conditional Comprehensions
- Performance Considerations
- Iterable
- Iterator
iter()next()__iter__()__next__()StopIteration- Custom Iterators
- Lazy Evaluation
- Generator Functions
yield- Generator Expressions
- Generator State
send()throw()close()yield from- Lazy Data Processing
- Memory Efficiency
- Nested Functions
- Closures
- Free Variables
- Decorators
- Function Wrapping
functools.wraps- Parameterized Decorators
- Class Decorators
- Multiple Decorators
- String Creation
- String Indexing
- String Slicing
- String Methods
- String Formatting
- f-Strings
.format()- Alignment
- Precision
- Escape Characters
- Unicode
- Encoding
- Decoding
- Regular Expressions
re.search()re.match()re.fullmatch()re.findall()re.finditer()re.split()re.sub()- Metacharacters
- Character Classes
- Quantifiers
- Groups
- Capturing Groups
- Named Groups
- Lookahead
- Lookbehind
- Regex Flags
collectionsCounterdefaultdictOrderedDictdequenamedtupleChainMapUserDictUserListUserString
- What Is a Module?
- What Is a Package?
importfrom ... import- Import Aliases
- Import Search Path
sys.path__name____main__if __name__ == "__main__"- Absolute Imports
- Relative Imports
- Circular Imports
- Import System
- Import Hooks
- Syntax Errors
- Runtime Errors
- Logical Errors
- Exceptions
tryexceptelsefinally- Multiple Exceptions
- Exception Hierarchy
- Raising Exceptions
raise- Custom Exceptions
- Exception Chaining
from- Exception Best Practices
- Opening Files
- Reading Files
- Writing Files
- Appending Files
- File Modes
- Text Files
- Binary Files
- Encoding
- File Cursor
seek()tell()- Context Managers
with open()
- JSON
- CSV
- Pickle
- XML
- YAML
- Serialization
- Deserialization
- Security Risks of Pickle
datetimedatetimetimedelta- Time Zones
- UTC
- Formatting
- Parsing
- Unix Timestamp
- Classes
- Objects
- Attributes
- Methods
- Constructors
__init__- Instance Attributes
- Class Attributes
- Instance Methods
- Class Methods
- Static Methods
- Encapsulation
- Inheritance
- Multiple Inheritance
- Polymorphism
- Abstraction
- Composition
- Aggregation
- Association
- Method Overriding
super()- MRO
__str____repr____len____getitem____setitem____delitem____contains____iter____next____call____enter____exit__- Operator Overloading
- Rich Comparisons
- Numeric Protocols
- Descriptors
__get____set____delete__- Properties
@property- Custom Properties
- Metaclasses
type- Class Creation
__new____init____init_subclass____set_name____slots__
- What Is a Context Manager?
with__enter____exit__contextlib@contextmanager- Custom Context Managers
- Resource Management
- Assignment vs Copy
- Shallow Copy
- Deep Copy
copy.copy()copy.deepcopy()- Nested Objects
- Circular References
- Object Graphs
- Hash Functions
hash()- Hashability
- Hash Tables
- Dictionary Internals
- Set Internals
- Hash Collisions
- Dictionary Resizing
- List Internals
- Dynamic Arrays
- Tuple Internals
- Python Memory Model
- Stack
- Heap
- Reference Counting
- Garbage Collection
- Cyclic References
- Weak References
- Memory Leaks
gcModuleweakref
- Dynamic Typing
- Strong Typing
- Duck Typing
- Type Hints
typingAnyUnionOptionalLiteralTypeVarGenericProtocolCallableTypedDict- Type Aliases
- Static Type Checking
mypypyright
pip- PyPI
- Virtual Environments
venvpip freezerequirements.txt- Dependency Management
pyproject.toml- Package Structure
- Building Packages
- Publishing Packages
- Versioning
- Semantic Versioning
- Why Testing?
- Unit Testing
- Integration Testing
- System Testing
unittestpytest- Assertions
- Fixtures
- Mocking
- Test Coverage
- Test-Driven Development
- Property-Based Testing
- Debugging
pdb- Breakpoints
- Stack Traces
- Logging
- Log Levels
- Log Handlers
- Formatters
- Structured Logging
- Error Tracking
- Time Complexity
- Space Complexity
- Big-O
- Profiling
timeitcProfileprofiletracemalloc- Optimization
- Algorithm Selection
- Memory Optimization
- Concurrency
- Parallelism
- Processes
- Threads
- Async Programming
threadingmultiprocessingconcurrent.futuresasyncioasyncawait- Event Loop
- Coroutines
- Tasks
- Futures
- GIL
- CPython Architecture
- Python Interpreter
- Bytecode
dis- AST
ast- Import Machinery
- Garbage Collector
- Reference Counting
- C Extensions
- Python C API
- Cython
- Alternative Python Implementations
- Input Validation
- Injection Attacks
- Unsafe Deserialization
- Secrets Management
- Password Hashing
- Cryptography
- Secure Randomness
- Dependency Security
- Environment Variables
- Secure File Handling
- PEP 8
- PEP 20 β The Zen of Python
- Clean Code
- SOLID Principles
- DRY
- KISS
- YAGNI
- Design Patterns
- Repository Structure
- Configuration Management
- Environment Management
- Documentation
- Code Review
- Git Workflow
- CI/CD
- Production Deployment
The most important concept in Python is:
NAME
β
REFERENCE
β
OBJECT
β
TYPE + VALUE + IDENTITY
Example:
x = [1, 2, 3]Conceptually:
x
β
ββββββββββββββββΊ List Object
β
βββ Type: list
βββ Identity: memory identity
βββ Value: [1, 2, 3]
Understanding this explains:
- Mutable vs immutable
- Assignment
- Copying
- Function arguments
- Lists inside tuples
- Hashability
- Memory behavior
- Object identity
Python Source Code
β
Lexer
β
Parser
β
AST
β
Compiler
β
Bytecode
β
Python Virtual Machine
β
Python Objects
β
Program Output
Example:
x = 10
print(x)Conceptually:
Source Code
β
Parse
β
Compile
β
Bytecode
β
PVM
β
Create Integer Object
β
Bind x to Object
β
Call print()
If your goal is Backend Engineering and AI Engineering, prioritize these:
| Priority | Concept | Why It Matters |
|---|---|---|
| βββββ | Objects & References | Foundation of Python behavior |
| βββββ | Mutability | Prevents unexpected bugs |
| βββββ | Data Structures | Used everywhere |
| βββββ | Functions | Core of reusable code |
| βββββ | OOP | Essential for large systems |
| βββββ | Exceptions | Production reliability |
| βββββ | Modules & Packages | Real project structure |
| βββββ | Iterators & Generators | Efficient data processing |
| βββββ | Memory Management | Performance understanding |
| βββββ | Async Programming | Backend scalability |
| βββββ | Testing | Professional development |
| ββββ | Type Hints | Maintainable code |
| ββββ | Concurrency | High-performance systems |
| ββββ | Packaging | Reusable software |
| ββββ | Security | Production applications |
For every concept, use this framework:
What is it?
Why does it exist?
How do we write it?
What happens when it runs?
What happens inside Python?
How do we use it?
What errors do beginners make?
How is it different from similar concepts?
How does it affect time and memory?
Can you solve problems using it?
1. Python Syntax
β
2. Data Types
β
3. Objects & References
β
4. Mutability & Immutability
β
5. Operators
β
6. Control Flow
β
7. Functions
β
8. Scope & LEGB
β
9. Data Structures
β
10. Comprehensions
β
11. Iterators
β
12. Generators
β
13. Decorators
β
14. Modules & Packages
β
15. Exceptions
β
16. File Handling
β
17. OOP
β
18. Dunder Methods
β
19. Memory Management
β
20. Hashing
β
21. Context Managers
β
22. Descriptors
β
23. Type Hints
β
24. Testing
β
25. Packaging
β
26. Performance
β
27. Concurrency
β
28. Async Python
β
29. Backend Development
β
30. AI/ML Engineering
You can write:
if
for
while
function
list
dict
classYou understand:
Objects
References
Memory
Mutability
Scope
Iterators
Generators
Exceptions
OOP
You understand:
Decorators
Descriptors
Context Managers
Metaclasses
Typing
Memory Management
Bytecode
Concurrency
Asyncio
You can build:
Production APIs
Backend Systems
Data Pipelines
AI Systems
Distributed Services
High-Performance Applications
Reusable Packages
Do not try to study all 480 topics equally.
Use this priority:
Objects
References
Data Types
Functions
Data Structures
Scope
Exceptions
OOP
Modules
Iterators
Generators
Memory
Hashing
Garbage Collection
Bytecode
Python Execution
Descriptors
Testing
Typing
Packaging
Performance
Concurrency
Asyncio
Security
Architecture
The most important transition in your Python learning journey is:
From βI know Python syntaxβ β βI understand how Python worksβ β βI can design reliable Python systems.β
This documentation structure can serve as your complete Python Core Knowledge roadmap and reference system.