Advertisement
JkSoftware

Day 5 - Exercise Avg Height

Nov 8th, 2021
563
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 in cm or in ").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. sum_ = 0
  7. num = len(student_heights)
  8. avg = 0
  9. for i in range(0, len(student_heights)):
  10.     sum_ += student_heights[i]
  11. avg = sum_ / num
  12. print(round(avg, 1))
  13.  
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement