Session 18 Preparation — Videos, Reading and Quizzes

Quiz

Do this Quiz on Session 18 as you watch the videos and do the reading (as listed below). This document is a Microsoft Word document; here is the same Quiz on Session 18 (pdf) as a PDF.

You can either:

Bring your solution (and questions about it) to class.

Videos and Reading:

All of the following are required except items labeled Optional are, well, optional (i.e., things that may be interesting but do not directly pertain to your success in this course).

  1. 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.

  2. Formatting strings — details

    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.

  3. Loops within Loops (aka Nested Loops) — How they work
  4. A Technique for Solving Print-On-Console Loop-Within-Loop Problems
    • This Video [8:20 minutes]
  5. Solved examples to watch AS YOU DO THE IN-CLASS exercises (and NOT before then):

    The following two videos are for the “ live coding ” that your instructor may do with you in Sessions 18 and/or 19. They will be most useful to you if you:

    • Do the coding AS YOU WATCH THE VIDEOS.
    • Do NOT watch them now, since you do not yet have the project with the problems. (Although you may watch them now, if you wish.)
    • Wait for class. Your instructor may or may not have you watch these videos then.