3. The marker…¶

3.1. Tracking 3 scores is complicated¶
Data file:
surf2_en.txt
21
file = open("surf2_en.txt")
first = 0
second = 0
third = 0
for line in file:
name, points = line.split()
if float(points) > first:
third = second
second = first
first = float(points)
elif float(points) > second:
third = second
second = float(points)
elif float(points) > third:
third = float(points)
file.close()
print("%.2f" % first)
print("%.2f" % second)
print("%.2f" % third)
Activity: 3.1.2 ActiveCode (ac_l37_3_en)
You have attempted 1 of 3 activities on this page