# Ultimate Python study guide [![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/huangsam/ultimate-python/ci.yml)](https://github.com/huangsam/ultimate-python/actions) [![Code Coverage](https://img.shields.io/codecov/c/github/huangsam/ultimate-python)](https://codecov.io/gh/huangsam/ultimate-python) [![License](https://img.shields.io/github/license/huangsam/ultimate-python)](https://github.com/huangsam/ultimate-python/blob/main/LICENSE) [![r/Python](https://img.shields.io/badge/reddit-original_post-red)](https://www.reddit.com/r/Python/comments/inllmf/ultimate_python_study_guide/) Ultimate Python study guide for newcomers and professionals alike. 🐍 🐍 🐍 ```python print("Ultimate Python study guide") ``` [English](README.md) | [ν•œκ΅­μ–΄](README.ko.md) | [繁体中文](README.zh_tw.md) | [EspaΓ±ol](README.es.md) | [Deutsch](README.de.md) | [FranΓ§ais](README.fr.md) | [ΰ€Ήΰ€Ώΰ€¨ΰ₯ΰ€¦ΰ₯€](README.hi.md) | [PortuguΓͺs - Brasil](README.pt_br.md) Ultimate Python ## Motivation I created this GitHub repo to share what I've learned about [core Python](https://www.python.org/) over the past 10+ years of using it as a college graduate, an employee at large-scale companies and an open-source contributor of repositories like [Celery](https://github.com/celery/celery) and [Full Stack Python](https://github.com/mattmakai/fullstackpython.com). I look forward to seeing more people learn Python and pursue their passions through it. πŸŽ“ ## Goals Here are the primary goals of creating this guide: πŸ† **Serve as a resource** for Python newcomers who prefer to learn hands-on. This repository has a collection of standalone modules which can be run in an IDE like [PyCharm](https://www.jetbrains.com/pycharm/) or in the browser via GitHub Codespaces. Even a plain old terminal will work with the examples. Most lines have carefully crafted comments which guide a reader through what the programs are doing step-by-step. Users are encouraged to modify source code anywhere as long as the `main` routines are not deleted and [run successfully](runner.py) after each change. πŸ† **Serve as a pure guide** for those who want to revisit core Python concepts. Only [builtin libraries](https://docs.python.org/3/library/) are leveraged so that these concepts can be conveyed without the overhead of domain-specific concepts. As such, popular open-source libraries and frameworks (i.e. `sqlalchemy`, `requests`, `pandas`) are not installed. However, reading the source code in these frameworks is inspiring and highly encouraged if your goal is to become a true [Pythonista](https://www.urbandictionary.com/define.php?term=pythonista). ## Getting started [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/huangsam/ultimate-python) Click the badge above to spin up a working environment in the browser without needing Git and Python installed on your local machine. If these requirements are already met, feel free to clone the repository directly. Once the repository is accessible, you are ready to learn from the standalone modules. To get the most out of each module, read the module code and run it. There are two ways of running the modules: 1. Run a single module: `python ultimatepython/fundamentals/variable.py` 2. Run all of the modules: `python runner.py` ## Table of contents πŸ“š = External resource, 🍰 = Beginner topic, 🀯 = Advanced topic 1. **About Python** - Overview: [What is Python](https://github.com/trekhleb/learn-python/blob/master/src/getting_started/what_is_python.md) ( πŸ“š, 🍰 ) - Design philosophy: [The Zen of Python](https://www.python.org/dev/peps/pep-0020/) ( πŸ“š ) - Style guide: [Style Guide for Python Code](https://www.python.org/dev/peps/pep-0008/) ( πŸ“š, 🀯 ) - Data model: [Data model](https://docs.python.org/3/reference/datamodel.html) ( πŸ“š, 🀯 ) - Standard library: [The Python Standard Library](https://docs.python.org/3/library/) ( πŸ“š, 🀯 ) - Built-in functions: [Built-in Functions](https://docs.python.org/3/library/functions.html) ( πŸ“š ) 2. **Fundamentals** - Variable: [Built-in literals](ultimatepython/fundamentals/variable.py) ( 🍰 ) - Expression: [Numeric operations](ultimatepython/fundamentals/expression.py) ( 🍰 ) - String: [String operations](ultimatepython/fundamentals/string.py) ( 🍰 ) - List: [List operations](ultimatepython/fundamentals/list.py) ( 🍰 ) - Tuple: [Tuple operations](ultimatepython/fundamentals/tuple.py) - Set: [Set operations](ultimatepython/fundamentals/set.py) - Dict: [Dictionary operations](ultimatepython/fundamentals/dict.py) ( 🍰 ) - Conditional: [if | if-else | if-elif-else](ultimatepython/fundamentals/conditional.py) ( 🍰 ) - Loop: [for-loop | while-loop](ultimatepython/fundamentals/loop.py) ( 🍰 ) - Function: [def | lambda](ultimatepython/fundamentals/function.py) ( 🍰 ) - Comprehension: [list | tuple | set | dict](ultimatepython/fundamentals/comprehension.py) 3. **Object-Oriented Programming** - Basic class: [Basic definition](ultimatepython/oop/basic_class.py) ( 🍰 ) - Data class: [dataclass](ultimatepython/oop/dataclass.py) ( 🍰 ) - Inheritance: [Inheritance](ultimatepython/oop/inheritance.py) ( 🍰 ) - Encapsulation: [Encapsulation definition](ultimatepython/oop/encapsulation.py) - Property: [property | setter | deleter](ultimatepython/oop/property.py) ( 🍰 ) - Enum: [Enum | auto | Flag](ultimatepython/oop/enum.py) ( 🍰 ) - Abstract class: [Abstract definition](ultimatepython/oop/abstract_class.py) - Exception class: [Exception definition](ultimatepython/oop/exception_class.py) - Iterator class: [Iterator definition | yield](ultimatepython/oop/iterator_class.py) ( 🀯 ) - Mixin: [Mixin definition](ultimatepython/oop/mixin.py) ( 🀯 ) - Method resolution order: [mro](ultimatepython/oop/mro.py) ( 🀯 ) 4. **Data Structures** - Deque: [deque](ultimatepython/data_structures/deque.py) ( 🀯 ) - Namedtuple: [namedtuple](ultimatepython/data_structures/namedtuple.py) ( 🀯 ) - OrderedDict: [OrderedDict](ultimatepython/data_structures/ordereddict.py) ( 🀯 ) - Defaultdict: [defaultdict](ultimatepython/data_structures/defaultdict.py) ( 🀯 ) - Heap: [heap queue](ultimatepython/data_structures/heap.py) ( 🀯 ) 5. **Standard Library** - File Handling: [File Handling](ultimatepython/stdlib/file_handling.py) ( 🀯 ) - Regular expression: [search | findall | match | fullmatch](ultimatepython/stdlib/regex.py) ( 🀯 ) - Data format: [json | xml | csv](ultimatepython/stdlib/data_format.py) ( 🀯 ) - Datetime: [datetime | timezone](ultimatepython/stdlib/date_time.py) ( 🀯 ) - Itertools: [Iterator tools](ultimatepython/stdlib/itertools.py) ( 🀯 ) 6. **Advanced** - Decorator: [Decorator definition | wraps](ultimatepython/advanced/decorator.py) ( 🀯 ) - Context manager: [Context managers](ultimatepython/advanced/context_manager.py) ( 🀯 ) - Metaclass: [Metaclass definition](ultimatepython/advanced/meta_class.py) ( 🀯 ) - Weak reference: [weakref](ultimatepython/advanced/weak_ref.py) ( 🀯 ) - Walrus operator: [Assignment expressions :=](ultimatepython/advanced/walrus_operator.py) ( 🀯 ) - Argument enforcement: [Positional-only / | Keyword-only *](ultimatepython/advanced/arg_enforcement.py) ( 🀯 ) - Dict union: [Dictionary merge | and |=](ultimatepython/advanced/dict_union.py) ( 🀯 ) - Pattern matching: [match | case](ultimatepython/advanced/pattern_matching.py) ( 🀯 ) - Template strings: [Template strings | t"..."](ultimatepython/advanced/template_strings.py) ( 🀯 ) 7. **Concurrency** - Thread: [ThreadPoolExecutor](ultimatepython/concurrency/thread.py) ( 🀯 ) - Process: [ProcessPoolExecutor](ultimatepython/concurrency/process.py) ( 🀯 ) - Asyncio: [async | await](ultimatepython/concurrency/async.py) ( 🀯 ) - Subinterpreters: [concurrent.interpreters](ultimatepython/concurrency/subinterpreters.py) ( 🀯 ) 8. **Engineering** - Mocking: [MagicMock | PropertyMock | patch](ultimatepython/engineering/mocking.py) ( 🀯 ) - Benchmark: [cProfile | pstats](ultimatepython/engineering/benchmark.py) ( 🀯 ) - Memory profile: [tracemalloc | take_snapshot](ultimatepython/engineering/memory_profile.py) ( 🀯 ) - Logger: [logging | getLogger | Handler](ultimatepython/engineering/logger.py) ( 🀯 ) - Bitwise: [Bitwise operators](ultimatepython/engineering/bitwise.py) ( 🍰 ), [One's/Two's Complement](https://www.geeksforgeeks.org/difference-between-1s-complement-representation-and-2s-complement-representation-technique/) ( πŸ“š ) - Time complexity: [cPython operations](https://wiki.python.org/moin/TimeComplexity) ( πŸ“š, 🀯 ) ## Additional resources πŸ‘” = Interview resource, πŸ§ͺ = Code samples, 🧠 = Project ideas ### GitHub repositories Keep learning by reading from other well-regarded resources. #### Core Python & patterns - [TheAlgorithms/Python](https://github.com/TheAlgorithms/Python) ( πŸ‘”, πŸ§ͺ ) - [faif/python-patterns](https://github.com/faif/python-patterns) ( πŸ‘”, πŸ§ͺ ) - [geekcomputers/Python](https://github.com/geekcomputers/Python) ( πŸ§ͺ ) - [practical-tutorials/project-based-learning](https://github.com/practical-tutorials/project-based-learning#python) ( 🧠 ) #### Data science & machine learning - [trekhleb/homemade-machine-learning](https://github.com/trekhleb/homemade-machine-learning) ( πŸ§ͺ ) - [microsoft/ML-For-Beginners](https://github.com/microsoft/ML-For-Beginners) ( πŸ§ͺ ) - [microsoft/Data-Science-For-Beginners](https://github.com/microsoft/Data-Science-For-Beginners) ( πŸ§ͺ ) - [academic/awesome-datascience](https://github.com/academic/awesome-datascience) - [josephmisiti/awesome-machine-learning](https://github.com/josephmisiti/awesome-machine-learning) #### Curated lists & project ideas - [MunGell/awesome-for-beginners](https://github.com/MunGell/awesome-for-beginners) ( 🧠 ) - [vinta/awesome-python](https://github.com/vinta/awesome-python) - [lukasmasuch/best-of-python](https://github.com/lukasmasuch/best-of-python) - [freeCodeCamp/freeCodeCamp](https://github.com/freeCodeCamp/freeCodeCamp) ( πŸ‘” ) ### Interactive practice Keep practicing so that your coding skills don't get rusty. #### Interview preparation - [leetcode.com](https://leetcode.com/) ( πŸ‘” ) - [hackerrank.com](https://www.hackerrank.com/) ( πŸ‘” ) - [geeksforgeeks.org](https://www.geeksforgeeks.org/) ( πŸ‘” ) #### Hands-on learning - [exercism.io](https://exercism.io/) ( πŸ§ͺ ) - [codewars.com](https://www.codewars.com/) ( πŸ§ͺ ) - [labex.io](https://labex.io/exercises/python) ( πŸ§ͺ ) - [teclado.com](https://teclado.com/30-days-of-python/#prerequisites) ( πŸ§ͺ ) - [projecteuler.net](https://projecteuler.net/) ( πŸ§ͺ ) - [kaggle.com](https://www.kaggle.com/) ( 🧠 )