7 November

### Tips for A4

# Input 4 scores, use separate variables.

# Compute an average:

average = quiz1 + quiz2 / 2 # WRONG due to order of operations

average = (quiz1 + quiz2) / 2 # OK

# Another way -- might make it easier to drop lowest.
sum = quiz1 + quiz2
average = sum / 2

# Convert to letter grade
if average >= 90:
print "A"
else:
if average >= 80:
print "B"
# you continue

# Determine the lowest of 3 (you have to do 4)
if quiz1 < quiz2 and quiz1 < quiz3:
lowest = quiz1
else:
if quiz2 < quiz1 and quiz1 < quiz3:
lowest = quiz2
else:
## determine if quiz3 is lowest.

©2011 Christopher League · some rights reserved · CC by-sa