Session 7 Preparation — Videos, Reading and Quizzes

Quizzes:

Do this Quiz on Session 7 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 7 (pdf) as a PDF.

You can either:

In either case, turn it in via the Session 7 Dropbox on our Moodle site.

Videos and Reading (online and textbook):

All of the following are required except the 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. Visit Piazza at: http://piazza.com/rose-hulman/summer2014/csse120 and:
    • Browse the questions and answers briefly.
    • Locate the question and answer you need for Quiz Question 1.
    • If you have questions of your own, ask them!
  2. Textbook reading: Section 3.7 —Boolean Variables and Operators (pages 118 - 124, 7 pages).

    Focus your attention on:

    • The concept of the bool type, and the two Boolean values True and False.
      • Note the capitalization!
    • The concept of a Boolean operator and the three Boolean operators:
      • and
      • or
      • not
      Table 5 on page 121 is especially helpful for understanding how they work.
    • Read Common Error 3.3 on page 121 and Special Topic 3.5 — De Morgan's Law carefully, as they will help you avoid some common abuses of Boolean operators.
    • Programming Tip 3.4 is more than just a tip; be sure you understand why the following are equivalent:
          if frozen == False:                     if not frozen:
              print('Not frozen')                     print('Not frozen')
      
    • In Special Topic 3.4 on Short-Circuit Evaluation of Boolean Operators, be sure you understand how short-circuit evaluation works and why it is valuable.
  3. Optional textbook reading: Special Topic 3.3 — Chaining Relational Operators (page 122 in Section 3.7, 1 page)
    • This section explains some syntactic sugar that is probably best avoided at this point, since (as your textbook points out) the chaining that Python allows is wrong (or error-prone) in many other languages.
  4. Optional textbook reading: Section 3.8 — Analyzing Strings (page 124 - 127, 4 pages)
    • A nice section with lots of examples of conditionals, but you can safely defer the details of this section. (We'll return to this section when we revisit strings later.)