Python quick start

The Python this club needs, taught on the robot: commands, variables, loops, decisions, functions and lists. An hour, then straight on to driving.

Module 0Robot club6 lessons

Start in the simulator
  1. 0.1 Your first program The two lines at the top, drive, wait, stop, print, and the rule that stops the robot on its own.
  2. 0.2 Numbers and names Variables, arithmetic, and driving an exact distance instead of counting seconds.
  3. 0.3 Doing it again for and while, indentation, and a square drawn with four lines instead of twelve.
  4. 0.4 Deciding if, else, comparisons, and a robot that looks with distance() before it moves.
  5. 0.5 Your own commands def, parameters and return: naming a piece of work so the program reads like what it does.
  6. 0.6 Lists of readings Lists, len, min and max, slices and looping over the 64 readings of the depth grid.