Advanced Python Exercises
Table of Contents
Topics
- Decorators
- Introduced in Python 2.4 (2005)
- Similar concepts: Annotations (Java), Attributes (C#)
- Introduced in Python 2.4 (2005)
- Generators
- Introduced in Python 2.2 (2001)
- Similar concepts: Iterator (Java), IEnumerable (C#)
- Introduced in Python 2.2 (2001)
- Context Managers
- Introduced in Python 2.5 (2006)
- Similar concepts: try-with-resources (Java), using (C#)
- Introduced in Python 2.5 (2006)
- Metaclasses
- Introduced in Python 2.2 (2001)
- Similar concepts: Reflection (Java), Reflection (C#)
- Introduced in Python 2.2 (2001)
- Descriptors
- Introduced in Python 2.2 (2001)
- Similar concepts: Property (C#), Getter/Setter (Java)
- Introduced in Python 2.2 (2001)
- Abstract Base Classes (ABC)
- Introduced in Python 2.6 (2008)
- Similar concepts: Interface (Java), Abstract Class (C#)
- Introduced in Python 2.6 (2008)
- Coroutines and Asynchronous Programming
- Coroutines introduced in Python 2.5 (2006)
- Async/await syntax introduced in Python 3.5 (2015)
- Similar concepts: Coroutines (C#), CompletableFuture (Java)
- Coroutines introduced in Python 2.5 (2006)
- Operator Overloading
- Introduced in Python 1.0 (1994)
- Similar concepts: Operator Overloading (C++), Operator Overloading (C#)
- Introduced in Python 1.0 (1994)
- Advanced List Comprehensions and Generator Expressions
- List comprehensions introduced in Python 2.0 (2000)
- Generator expressions introduced in Python 2.4 (2005)
- Similar concepts: Stream API (Java), LINQ (C#)
- List comprehensions introduced in Python 2.0 (2000)
- Closures
- Introduced in Python 2.2 (2001)
- Similar concepts: Lambda Expressions (Java), Anonymous Functions (C#)
- Introduced in Python 2.2 (2001)
Instructions
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.
Resources
Official Documentation
Books
- 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
Online Tutorials and Courses
Blogs and Articles
Communities and Forums
YouTube Channels
- Python Documentation: https://docs.python.org/
- Real Python: https://realpython.com/