True False
if foo == bar: # header clause 1 print('same') # suite/block clause 1 else: # header clause 2 print('different') # suite/block clause 2
if condition:
suite
if condition: suite else: suite
if credits == 90: print('Senior') else if credits == 60: print('Junior') else: if credits >= 40: print('Sophomore') else: print('something else')
if credits >= 90: print('Senior') elif credits >= 60: print('Junior') elif credits >= 40: print('Sophomore') else: print('something else')
while condition:
suite:
definite loop: counter controlled repetition, “a program loop in which the number of times the loop will iterate can be determined before the loop is executed.”
indefinite loop: sentinel controlled repetition, “a program loop in which the number of times the loop will iterate is not known before the loop is executed.”
flag/semaphore/sentinel: TODO.