Learn Python by writing tests first and then implementing the solution as per testfirst.org. Ported from Alex Chaffee's learn_ruby.
The lessons are stored in distinct directories, numbered in order of increasing difficulty:
- 00_hello
- 01_temperature
- 02_calculator
- 03_simon_says
- etc
In each directory, run the test_*.py file on the command line. For example:
$ cd 00_hello
$ ./test_hello.py
Implement hello.py
a little bit at a time and fix the errors indicated by test_hello.py
one by one by until there are no more errors. If you are stuck, take a look at the xx_solution
branch. For example, the 00_solution
branch contains a hello.py
that passes all the tests in test_hello.py
.