Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
#+TITLE: Advanced Python Exercises #+AUTHOR: Jason Walsh <j@wal.sh> 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. * Getting Started #+begin_src sh make install make venv make new-exercise #+end_src * Primary Topics ** [[file:decorators.py][Decorators]] - Introduced in Python 2.4 (2005) - Similar concepts: Annotations (Java), Attributes (C#) ** [[file:generators.py][Generators]] - Introduced in Python 2.2 (2001) - Similar concepts: Iterator (Java), IEnumerable (C#) ** [[file:context_managers.py][Context Managers]] - Introduced in Python 2.5 (2006) - Similar concepts: try-with-resources (Java), using (C#) ** [[file:metaclasses.py][Metaclasses]] - Introduced in Python 2.2 (2001) - Similar concepts: Reflection (Java), Reflection (C#) ** [[file:descriptors.py][Descriptors]] - Introduced in Python 2.2 (2001) - Similar concepts: Property (C#), Getter/Setter (Java) ** [[file:abstract_base_classes.py][Abstract Base Classes (ABC)]] - Introduced in Python 2.6 (2008) - Similar concepts: Interface (Java), Abstract Class (C#) ** [[file:coroutines_async.py][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) ** [[file:operator_overloading.py][Operator Overloading]] - Introduced in Python 1.0 (1994) - Similar concepts: Operator Overloading (C++), Operator Overloading (C#) ** [[file:advanced_comprehensions.py][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#) ** [[file:closures.py][Closures]] - Introduced in Python 2.2 (2001) - Similar concepts: Lambda Expressions (Java), Anonymous Functions (C#) ** [[file:domain_modeling.py][Domain Modeling with Classes]] - One-to-Many and Many-to-Many Relationships - Modeling Pet, Category, Tag ** [[file:decorators_with_arguments.py][Decorators with Arguments]] - Passing arguments to decorators - Decorators with optional arguments ** [[file:itertools_module.py][Itertools Module]] - Important functions in the itertools module - Creating efficient iterators and combinatoric generators ** [[file:functools_module.py][Functools Module]] - Useful functions in the functools module - Partial function application and reducing functions ** [[file:advanced_oop_patterns.py][Advanced OOP Patterns]] - Singleton, Factory, and Observer patterns - Implementing design patterns in Python ** [[file:concurrency_and_parallelism.py][Concurrency and Parallelism]] - Threading and multiprocessing modules - Concurrent execution and parallel processing ** [[file:advanced_error_handling.py][Advanced Error Handling]] - Custom exceptions and exception hierarchies - Contextual exception handling and logging ** [[file:metaprogramming.py][Metaprogramming]] - Code introspection and manipulation - Modifying behavior at runtime ** [[file:performance_optimization.py][Performance Optimization]] - Profiling and benchmarking code - Techniques for optimizing Python performance ** [[file:advanced_testing.py][Advanced Testing]] - Mocking and patching in unit tests - Integration testing and test automation * New Language Features ** [[file:python_3_8_features.py][Python 3.8 Features]] - Avoiding naming conflicts ** [[file:library_development.py][Library Development]] - Creating reusable libraries - Packaging and distributing code ** [[file:logging.py][Logging]] - Effective logging techniques - Configuring and managing log messages ** [[file:serialization.py][Serialization]] - Serializing and deserializing objects - Working with JSON, Pickle, and other formats ** [[file:networking.py][Networking]] - Socket programming - Client-server communication ** [[file:web_scraping.py][Web Scraping]] - Extracting data from websites - Using libraries like BeautifulSoup and Scrapy ** [[file:data_visualization.py][Data Visualization]] - Creating visual representations of data - Using libraries like Matplotlib and Seaborn ** [[file:gui_development.py][GUI Development]] - Building graphical user interfaces - Using frameworks like Tkinter and PyQt ** [[file:database_integration.py][Database Integration]] - Interacting with databases - Using libraries like SQLAlchemy and Psycopg2 ** [[file:api_development.py][API Development]] - Designing and building APIs - Using frameworks like Flask and FastAPI * Foundational Topics ** [[file:variables_and_data_types.py][Variables and Data Types]] - Declaring variables - Primitive data types (int, float, bool, str) - Type conversion ** [[file:control_flow.py][Control Flow]] - if-else statements - for and while loops - break, continue, and pass statements ** [[file:functions.py][Functions]] - Defining and calling functions - Parameters and arguments - Return values ** [[file:lists_and_tuples.py][Lists and Tuples]] - Creating and manipulating lists - Accessing elements - List methods and functions - Tuples and immutability ** [[file:dictionaries_and_sets.py][Dictionaries and Sets]] - Creating and working with dictionaries - Accessing and modifying key-value pairs - Sets and set operations ** [[file:strings.py][Strings]] - String manipulation - Formatting strings - Common string methods ** [[file:file_handling.py][File Handling]] - Reading from and writing to files - File modes and permissions - Context managers for file handling ** [[file:modules_and_packages.py][Modules and Packages]] - Importing modules - Creating and using packages - Namespace and scope ** [[file:exception_handling.py][Exception Handling]] - Handling exceptions with try-except - Raising exceptions - Custom exception classes ** [[file:object_oriented_programming.py][Object-Oriented Programming (OOP)]] - Classes and objects - Inheritance and polymorphism - Encapsulation and data hiding * 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 - [[https://docs.python.org/][Python Documentation]] - [[https://docs.python.org/3/tutorial/index.html][Python Tutorial]] - [[https://docs.python.org/3/library/index.html][Python Standard Library]] - [[https://docs.python.org/3/reference/index.html][Python Language Reference]] ** Books - [[https://realpython.com/products/fluent-python/][Fluent Python]] by Luciano Ramalho - [[https://realpython.com/products/python-workout/][Python Workout]] by Reuven M. Lerner - [[https://realpython.com/products/practices-of-the-python-pro/][Practices of the Python Pro]] by Dane Hillard - [[https://www.oreilly.com/library/view/effective-python-90/9780134854717/][Effective Python: 90 Specific Ways to Write Better Python]] by Brett Slatkin - [[https://www.oreilly.com/library/view/python-cookbook-3rd/9781449357337/][Python Cookbook]] by David Beazley and Brian K. Jones - [[https://www.oreilly.com/library/view/python-tricks-a/9781775093305/][Python Tricks: A Buffet of Awesome Python Features]] by Dan Bader ** Online Tutorials and Courses - [[https://realpython.com/][Real Python]] - [[https://www.learnpython.org/][Learn Python]] - [[https://www.codecademy.com/learn/learn-python][Codecademy: Learn Python]] - [[https://www.coursera.org/specializations/python][Coursera: Python for Everybody Specialization]] - [[https://www.edx.org/course/introduction-to-python-absolute-beginner][edX: Introduction to Python - Absolute Beginner]] - [[https://www.udemy.com/course/complete-python-bootcamp/][Udemy: Complete Python Bootcamp]] - [[https://wizardforcel.gitbooks.io/sicp-in-python/content/][SICP in Python]] ** Blogs and Articles - [[https://realpython.com/tutorials/advanced/][Real Python: Advanced Tutorials]] - [[https://www.pythonforbeginners.com/][Python for Beginners]] - [[https://www.fullstackpython.com/][Full Stack Python]] - [[https://www.geeksforgeeks.org/python-programming-language/][GeeksforGeeks: Python Programming Language]] - [[https://www.programiz.com/python-programming][Programiz: Python Programming]] ** Communities and Forums - [[https://stackoverflow.com/questions/tagged/python][Stack Overflow: Python Questions]] - [[https://www.reddit.com/r/Python/][Reddit: Python Subreddit]] - [[https://www.reddit.com/r/learnpython/][Reddit: Learn Python Subreddit]] - [[https://python-forum.io/][Python Forum]] - [[https://www.python.org/community/][Python.org Community]] ** Podcasts - [[https://realpython.com/podcasts/rpp/][Real Python Podcast]] - [[https://talkpython.fm/][Talk Python To Me]] - [[https://pythonbytes.fm/][Python Bytes]] - [[https://www.pythonpodcast.com/][Podcast.__init__]] ** YouTube Channels - [[https://www.youtube.com/channel/UCCezIgC97PvUuR4_gbFUs5g][Corey Schafer]] - [[https://www.youtube.com/channel/UC-QDfvrRIDB6F0bIO4I4HkQ][Real Python]] - [[https://www.youtube.com/channel/UCWv7vMbMWH4-V0ZXdmDpPBA][Programming with Mosh]] - [[https://www.youtube.com/channel/UCfv8cds8AfIM3UZtAWOz6Gg][Sentdex]] - [[https://www.youtube.com/channel/UCu8xYGLic-dmiKlsLVdyQXg][Tech With Tim]] - Python Documentation: https://docs.python.org/ - Real Python: https://realpython.com/