Learn Python with Tests
Learn test-driven development with Python
- Explore the Python language by writing tests
- Get a grounding with TDD. Python is a great language for learning TDD because it is a simple language to learn and testing is built-in with
unittestand made even easier withpytest - Be confident that you'll be able to start writing robust, well-tested systems in Python
Background
Learning a new programming language can be challenging. This book takes a different approach - instead of just reading about concepts, you'll learn by doing. Each chapter introduces a new Python concept and teaches it through test-driven development (TDD).
The TDD approach
By far the most effective way to learn is by slowly introducing the fundamentals of the language, exploring them with examples, and solidifying the ideas with tests. Tests verify the code you write is correct and document the features you have learned.
This approach is analogous to practicing scales when trying to learn guitar. It doesn't matter how artistic you think you are, you are unlikely to write good music without understanding the fundamentals and practicing the mechanics.
What works
What I like to do is explore concepts and then solidify the ideas with tests. Tests verify the code I write is correct and documents the feature I have learned.
Learning the fundamentals by writing small tests allows you to take your existing software design skills and ship great systems.
Who this is for
- People who are interested in picking up Python
- People who already know some Python, but want to explore testing with TDD
- People coming from other languages who want to learn Python through practical examples
What you'll need
- A computer!
- Installed Python 3.x
- A text editor (VS Code, PyCharm, or similar)
- Some experience with programming. Understanding of concepts like
if, variables, functions etc. - Comfortable using the terminal
Feedback
- Visit ehsankhakifirooz.com for updates and contact
- This course content is released under the MIT License