Python, No Tears
This edition is updated for Python 3.13.
Preface
This book is an introduction to programming in Python. The examples and recommendations in this edition target Python 3.13. You can follow along with a local Python 3.13 installation, but a Docker image is also available if you want a preconfigured environment with JupyterLab already set up. The diagram below is the book roadmap, showing that the material starts with core syntax, then adds control flow and reusable code, and only after that moves into objects, the standard library, and practice-heavy chapters.
Use that roadmap when jumping around the book: chapters later in the chain assume more vocabulary and more comfort with Python’s built-in tools. To run the Docker image, use the following command.
docker run -it \
-p 8888:8888 \
oneoffcoder/book-python-intro
The Docker container starts JupyterLab on port 8888. When the container is running, you can open it at http://localhost:8888.
Contents
- 1. Hello, World!
- 2. Types
- 3. Operators
- 4. Control Statements
- 5. Structural Pattern Matching
- 6. User Input
- 7. Loops
- 8. Functions
- 8.1. Basic function
- 8.2. Function with one arguments
- 8.3. Function with two arguments
- 8.4. Function with three arguments
- 8.5. Function with a list argument
- 8.6. Function with default value argument
- 8.7. Non-keyworded, variable-length argument
- 8.8. Keyworded, variable-length argument
- 8.9. Mixed arguments
- 8.10. Required keyword arguments
- 8.11. Unpacking tuple return type
- 8.12. Lambda
- 8.13. Generators
- 9. Code Documentation
- 10. Built-in Functions and Types
- 11. Collections Gems
- 12. Functional Programming
- 13. Decorators
- 14. Classes
- 15. Dataclasses
- 16. Enumerations
- 17. Typing
- 18. Libraries
- 19. JSON
- 20. CSV
- 21. Pathlib
- 22. Randomness
- 23. Dates, Times, and Time Zones
- 24. TOML Configuration
- 25. Command-Line Arguments
- 26. Running Commands with subprocess
- 27. Logging
- 28. Exceptions
- 29. Context Manager
- 30. Threading
- 31. Input/Output (IO)
- 32. Testing
- 33. Turtle
- 34. Mini Projects
- 35. Practice, Practice, Practice
- 36. Python 3.13 Notes
Nifty Libraries
About
One-Off Coder is an educational, service and product company. Please visit us online to discover how we may help you achieve life-long success in your personal coding career or with your company’s business goals and objectives.
Copyright
Cite this book as follows.:
@misc{oneoffcoder_python_intro_2019,
title={Python, No Tears},
url={https://learn-python.oneoffcoder.com},
author={One-Off Coder},
year={2019},
month={Oct}}