Skip to content

Commit 92a43d2

Browse files
author
rakesh
committed
commit
1 parent 3ba0e41 commit 92a43d2

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

loops/for_loops.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Input a Python list of student heights
2+
student_heights = input().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+
# Write your code below this row 👇
8+
total_height = 0
9+
total_count = 0
10+
for i in student_heights:
11+
total_height += i
12+
total_count += 1
13+
14+
average_height = round(total_height / total_count)

0 commit comments

Comments
 (0)