TEMA
RUNTIME ERROR, PYTHON 3 WHY??
DrMatth preguntado 3 years ago
comidas = ["suco de laranja", "morango fresco", "mamao", "goiaba vermelha", "manga", "laranja", "brocolis"]
vitaminas = [120, 85, 85, 70, 56, 50, 34]
t = int(input())
while t:
total = 0
for _ in range(t):
line = input()
cant, opc = int(line[0]), line[2:]
total += vitaminas[comidas.index(opc)] * cant
if total > 130:
print('Menos {} mg'.format(total - 130))
elif total < 110:
print('Mais {} mg'.format(110 - total))
else:
print(total, 'mg')
t = int(input())
Este tema aún no ha sido contestado. ¡Sé el primero!