3. El marcador…¶

3.1. El seguimiento de 3 puntajes es complicado¶
Data file:
surf2.txt
xxxxxxxxxx
archivo = open("surf2.txt")
primero = 0
segundo = 0
tercero = 0
for linea in archivo:
nombre, puntos = linea.split()
if float(puntos) > primero:
tercero = segundo
segundo = primero
primero = float(puntos)
elif float(puntos) > segundo:
tercero = segundo
segundo = float(puntos)
elif float(puntos) > tercero:
tercero = float(puntos)
archivo.close()
print("%.2f" % primero)
print("%.2f" % segundo)
print("%.2f" % tercero)
Activity: 3.1.2 ActiveCode (ac_l37_3)
You have attempted 1 of 3 activities on this page