Session 16 Preparation — Videos, Reading and Quizzes

Instructions:

For each of the following videos or reading:

Videos and Reading:

  1. The   Wait Until Event Pattern   and   while True:   Loops

    Note: WHILE loops are traditionally introduced in the form:

    while some-condition:
        do-stuff

    We will instead use the less common form:

    while True:
        do-stuff-here-if-you-want
        if some-condition:
            break
        do-stuff-here-if-you-want

    See the video for details.

  2. Formatting strings (to make them look pretty, or like you want them to look) — basic idea

    To get you started, read this explanation of the basic idea of the format method.

  3. Formatting strings — details

    Optional reading: From The Python 3 Tutorial, read ONLY the following sections of the chapter on Formatted Output:

    • Three Ways for a Nicer Output
    • The Pythonic Way: The string method “format”
      • But just SKIM over the details,knowing that you can return to them for reference as needed.

    Skip the section titled The Old Way or the non-existing printf and sprintf. Of course, you are welcome to read that section, but it shows an older way to format strings that is no longer recommended for Python.