average-height.py 353 B

1234567891011121314
  1. student_heights = input("Input a list of student heights: ").split()
  2. for n in range(0, len(student_heights)):
  3. student_heights[n] = int(student_heights[n])
  4. print(student_heights)
  5. total_height = 0
  6. students_counter = 0
  7. for height in student_heights:
  8. total_height += height
  9. students_counter += 1
  10. print(round(total_height / students_counter))