Zoom
  • Look at this quick example of an If-Statement!
  • Click the Next button in Python Tutor and run through the code.
  • Notice how lines 6 and 7 are skipped but the rest of the program executes.
  • This is because on line 3 we are saying "If sky_is_blue is True, then execute lines 4 and 5. Otherwise, execute line 7".
  • Line 9 isn't part of the If-statement, so it gets executed regardless.