```
WEEK03: booleans, logical operators, conditionals (if/else)
-----------------------------------------------------------
W: QUIZ 1, if/elif/elif/.../else, logical operators

BRANCHING...what if we need more than two branches???

--> use elif...

"""
J. Knerr -- Fall 2010
"""

def main():

letter = "A"
letter = "B"
letter = "C"
letter = "D"
else:
letter = "F"

main()

LOGICAL OPERATORS: and, or, not

--> can combine conditions with "and" and "or"

English: if (you start labs early) and (you study for quizzes)
==> you will do well in CS21

** only True if both are True

English: if (you eat lots of ice cream) or (you eat lots of candy)
==> you will get sick

** True if either or both are True

write these out in a TRUTH TABLE and make sure you understand them!

A=start labs early
B=study for quizzes
C=do well in CS21

if A and B: C

A     B      C
-----------------
True  True   True
False True   False
True  False  False
False False  False

>>> if speed < 70 and speed > 40:
...    print "no ticket...you can go"
... else:
...    print "you're either going too fast or two slow!"

--> can you write a "do you want to play?" program to

\$ python playgame.py
would you like to play a game? (y/n): yes
>>> SUPER. let's play tic-tac-toe...

\$ python playgame.py
would you like to play a game? (y/n): Yes
>>> SUPER. let's play tic-tac-toe...

\$ python playgame.py
would you like to play a game? (y/n): sure
>>> SUPER. let's play tic-tac-toe...

YOUR TURN: count to 100, but if the number is evenly divisible
by 3, say bizz instead of the number. If the number is evenly
divisible by 5, say buzz, and if evenly divisible by 3 and 5, say
bizzbuzz.

--> can you write the bizzbuzz game??

\$ python bizzbuzz.py
1
2
bizz (3)
4
buzz (5)
bizz (6)
7
8
bizz (9)
buzz (10)
11
bizz (12)
13
14
bizzbuzz (15)
16
17
bizz (18)
...
...
89
bizzbuzz (90)
91
92
bizz (93)
94
buzz (95)
bizz (96)
97
98
bizz (99)
buzz (100)

```