https://github.com/pycollege/python-by-example
A practical, example-driven guide to learning Python with clear explanations and real coding tasks.
https://github.com/pycollege/python-by-example
awesome-python python python-book python-books
Last synced: 8 days ago
JSON representation
A practical, example-driven guide to learning Python with clear explanations and real coding tasks.
- Host: GitHub
- URL: https://github.com/pycollege/python-by-example
- Owner: pycollege
- License: other
- Created: 2026-01-25T07:29:07.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2026-02-10T17:29:13.000Z (26 days ago)
- Last Synced: 2026-02-10T21:16:58.041Z (25 days ago)
- Topics: awesome-python, python, python-book, python-books
- Language: Python
- Homepage:
- Size: 54.7 KB
- Stars: 51
- Watchers: 6
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- books - 📖 Python by Example (2026)
README
# Python by Example
[Python](https://www.python.org/) is a versatile, readable programming language ideal for beginners and experts alike. Please read the [official documentation](https://docs.python.org/3/) to learn more.
*Python by Example* is a hands-on introduction to Python using annotated example programs. Check out the [first example](lessons/hello-world.md) or browse the full list below.
Unless stated otherwise, examples assume Python 3.10 or later. Try to upgrade to the latest version if something isn't working.
## Table of Contents
### Foundations
* [Hello World](lessons/hello-world.md)
* [Values](lessons/values.md)
* [Variables](lessons/variables.md)
* [Constants](lessons/constants.md)
* [For Loops](lessons/for-loops.md)
* [While Loops](lessons/while-loops.md)
* [If/Else](lessons/if-else.md)
* [Match](lessons/match.md)
* [Break and Continue](lessons/break-and-continue.md)
### Data Structures
* [Lists](lessons/lists.md)
* [Slicing](lessons/slicing.md)
* [Tuples](lessons/tuples.md)
* [Dictionaries](lessons/dictionaries.md)
* [Sets](lessons/sets.md)
### Functions
* [Functions](lessons/functions.md)
* [Multiple Return Values](lessons/multiple-return-values.md)
* [Variadic Functions](lessons/variadic-functions.md)
* [Lambdas](lessons/lambdas.md)
* [Closures](lessons/closures.md)
* [Recursion](lessons/recursion.md)
### Iteration and Comprehensions
* [Range and Enumerate](lessons/range-and-enumerate.md)
* [Comprehensions](lessons/comprehensions.md)
### Object-Oriented
* [Classes](lessons/classes.md)
* [Methods](lessons/methods.md)
* [Inheritance](lessons/inheritance.md)
* [Dataclasses](lessons/dataclasses.md)
* [Enums](lessons/enums.md)
* [Type Hints](lessons/type-hints.md)
### Error Handling
* [Exceptions](lessons/exceptions.md)
* [Custom Exceptions](lessons/custom-exceptions.md)
### Modules and Packages
* [Modules](lessons/modules.md)
* [Packages](lessons/packages.md)
### Async
* [Async Basics](lessons/async-basics.md)
* [Async Concurrency](lessons/async-concurrency.md)
* [Async Queues](lessons/async-queues.md)
### Strings and Formatting
* [Strings](lessons/strings.md)
* [String Formatting](lessons/string-formatting.md)
* [Regular Expressions](lessons/regular-expressions.md)
### Data and Serialization
* [JSON](lessons/json.md)
* [JSON Files](lessons/json-files.md)
### Date and Time
* [Time](lessons/time.md)
* [Time Formatting](lessons/time-formatting.md)
### File I/O
* [Reading Files](lessons/reading-files.md)
* [Writing Files](lessons/writing-files.md)
* [File Paths](lessons/file-paths.md)
* [Directories](lessons/directories.md)
* [Temporary Files](lessons/temporary-files.md)
### Command Line
* [Command-Line Arguments](lessons/command-line-arguments.md)
* [Argparse](lessons/argparse.md)
* [Environment Variables](lessons/environment-variables.md)
### Testing and Tooling
* [Testing](lessons/testing.md)
* [Logging](lessons/logging.md)
### Networking
* [HTTP Client](lessons/http-client.md)
* [HTTP Server](lessons/http-server.md)
### Misc
* [Random Numbers](lessons/random-numbers.md)
* [Exit](lessons/exit.md)
---
Licensed under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
by [Dariush Abbasi](https://github.com/dariubs) | [source](https://github.com/pycollege/python-by-example)