Advertisement
R8za

5.1 - Average Height

Jun 25th, 2022
531
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # 🚨 Don't change the code below 👇
  2. student_heights = input("Input a list of student heights ").split()
  3. for n in range(0, len(student_heights)):
  4.   student_heights[n] = int(student_heights[n])
  5. # 🚨 Don't change the code above 👆
  6.  
  7.  
  8. #Write your code below this row 👇
  9.  
  10. usuarios = 0
  11. altura_total = 0
  12. for altura_individual in student_heights:
  13.   altura_total += altura_individual
  14.   usuarios += 1
  15.  
  16.  
  17. altura_media = round(altura_total / usuarios)
  18. print(altura_media)
Advertisement
RAW Paste Data Copied
Advertisement