I’m not going to go into detail about Python syntax, but there is one thing it is very picky about, and must be mentioned.
This information comes from the Python Pocket Reference by Mark Lutz (greatly abridged). You will probably need to know a lot more about Python than this, but this is included because if the block rules are not followed, you will likely have trouble with the code in this tutorial.
Control Flow
Statements execute sequentially, one after another, unless control-flow statements are used to branch elsewhere in code (e.g., if, while, for, raise, calls, etc.).
Blocks
A nested block is delimited by indenting all of its statements by the same amount, with any number of spaces or tabs used consistently. A given block should use all tabs or all spaces for indentation.