7. Exercise List “again”¶
Conditions
3
print("Welcome to my program!")
print("Always come back!")
Activity: 7.1 ActiveCode (ac_l10_7_001_en)
Conditions – if
7
a = 8
b = 5
if a > b:
print("The first number is the largest")
if b > a:
print("The second number is the biggest!")
Activity: 7.2 ActiveCode (ac_l10_7_002_en)
Conditions – if / else
6
years_old = 1
if years_old <= 3:
print("his car is new")
if years_old > 3:
print("his car is old")
Activity: 7.3 ActiveCode (ac_l10_7_003_en)
nested structures
10
minutes = 800
if minutes < 200:
price = 0.20
else:
if minutes <= 400:
price = 0.18
else:
price = 0.15
print("phone account : $%6.2f" % (minutes * price))
Activity: 7.4 ActiveCode (ac_l10_7_004_en)
elif
11
minutes = 1000
if minutes < 200:
price = 0.2
elif minutes <= 400:
price = 0.18
elif minutes <= 800:
price = 0.15
else:
price = 0.08
print("phone account : $%6.2f" % (minutes * price))
Activity: 7.5 ActiveCode (ac_l10_7_005_en)

“Life is like riding a bicycle. To keep balance, you must keep moving”. - Einstein
Activity: 7.6 Poll (TWP10E)
You have attempted 1 of 7 activities on this page