This repository contains a collection of exercises and examples covering advanced Python concepts and techniques. It is designed to help Python developers enhance their skills and gain a deeper understanding of the language’s advanced features.
make install
make venv
make new-exercise
- Introduced in Python 2.4 (2005)
- Similar concepts: Annotations (Java), Attributes (C#)
- Introduced in Python 2.2 (2001)
- Similar concepts: Iterator (Java), IEnumerable (C#)
- Introduced in Python 2.5 (2006)
- Similar concepts: try-with-resources (Java), using (C#)
- Introduced in Python 2.2 (2001)
- Similar concepts: Reflection (Java), Reflection (C#)
- Introduced in Python 2.2 (2001)
- Similar concepts: Property (C#), Getter/Setter (Java)
- Introduced in Python 2.6 (2008)
- Similar concepts: Interface (Java), Abstract Class (C#)
- Coroutines introduced in Python 2.5 (2006)
- Async/await syntax introduced in Python 3.5 (2015)
- Similar concepts: Coroutines (C#), CompletableFuture (Java)
- Introduced in Python 1.0 (1994)
- Similar concepts: Operator Overloading (C++), Operator Overloading (C#)
- List comprehensions introduced in Python 2.0 (2000)
- Generator expressions introduced in Python 2.4 (2005)
- Similar concepts: Stream API (Java), LINQ (C#)
- Introduced in Python 2.2 (2001)
- Similar concepts: Lambda Expressions (Java), Anonymous Functions (C#)
- One-to-Many and Many-to-Many Relationships
- Modeling Pet, Category, Tag
- Passing arguments to decorators
- Decorators with optional arguments
- Important functions in the itertools module
- Creating efficient iterators and combinatoric generators
- Useful functions in the functools module
- Partial function application and reducing functions
- Singleton, Factory, and Observer patterns
- Implementing design patterns in Python
- Threading and multiprocessing modules
- Concurrent execution and parallel processing
- Custom exceptions and exception hierarchies
- Contextual exception handling and logging
- Code introspection and manipulation
- Modifying behavior at runtime
- Profiling and benchmarking code
- Techniques for optimizing Python performance
- Mocking and patching in unit tests
- Integration testing and test automation
- Avoiding naming conflicts
- Creating reusable libraries
- Packaging and distributing code
- Effective logging techniques
- Configuring and managing log messages
- Serializing and deserializing objects
- Working with JSON, Pickle, and other formats
- Socket programming
- Client-server communication
- Extracting data from websites
- Using libraries like BeautifulSoup and Scrapy
- Creating visual representations of data
- Using libraries like Matplotlib and Seaborn
- Building graphical user interfaces
- Using frameworks like Tkinter and PyQt
- Interacting with databases
- Using libraries like SQLAlchemy and Psycopg2
- Designing and building APIs
- Using frameworks like Flask and FastAPI
- Declaring variables
- Primitive data types (int, float, bool, str)
- Type conversion
- if-else statements
- for and while loops
- break, continue, and pass statements
- Defining and calling functions
- Parameters and arguments
- Return values
- Creating and manipulating lists
- Accessing elements
- List methods and functions
- Tuples and immutability
- Creating and working with dictionaries
- Accessing and modifying key-value pairs
- Sets and set operations
- String manipulation
- Formatting strings
- Common string methods
- Reading from and writing to files
- File modes and permissions
- Context managers for file handling
- Importing modules
- Creating and using packages
- Namespace and scope
- Handling exceptions with try-except
- Raising exceptions
- Custom exception classes
- Classes and objects
- Inheritance and polymorphism
- Encapsulation and data hiding
For each topic, complete the exercise in the corresponding Python file. The exercises are designed to help you practice and understand the advanced Python language features.
- Fluent Python by Luciano Ramalho
- Python Workout by Reuven M. Lerner
- Practices of the Python Pro by Dane Hillard
- Effective Python: 90 Specific Ways to Write Better Python by Brett Slatkin
- Python Cookbook by David Beazley and Brian K. Jones
- Python Tricks: A Buffet of Awesome Python Features by Dan Bader
- Real Python
- Learn Python
- Codecademy: Learn Python
- Coursera: Python for Everybody Specialization
- edX: Introduction to Python - Absolute Beginner
- Udemy: Complete Python Bootcamp
- SICP in Python
- Real Python: Advanced Tutorials
- Python for Beginners
- Full Stack Python
- GeeksforGeeks: Python Programming Language
- Programiz: Python Programming
- Stack Overflow: Python Questions
- Reddit: Python Subreddit
- Reddit: Learn Python Subreddit
- Python Forum
- Python.org Community
- Python Documentation: https://docs.python.org/
- Real Python: https://realpython.com/