mardi 27 octobre 2020

how can I loop through a tuple?


def grade(*score):
  for i in range(0, score):
    if score >= 90:
      return "A"
    elif score >=80:
      return "B"
    elif score >=70:
      return "C"
    elif score >=60:
      return "D"
    else:
      return "F"

print(grade(87, 92, 100, 54, 72, 84, 81, 74))

I want to be able to loop through the arguments and return the correct grade on each loop

Aucun commentaire:

Enregistrer un commentaire