From 4073573d6cbf786e0de9fdabb3fcdeb38ee33631 Mon Sep 17 00:00:00 2001 From: jeeban kumar sethi <53075161+kumarjeeban@users.noreply.github.com> Date: Sun, 9 Oct 2022 20:56:49 +0530 Subject: [PATCH] Add files via upload --- avg_height.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 avg_height.py diff --git a/avg_height.py b/avg_height.py new file mode 100644 index 00000000..11f8ef02 --- /dev/null +++ b/avg_height.py @@ -0,0 +1,19 @@ +#to calculate the average of a student height +student_heights = input("input a list of student heights: ").split() +for n in range (0, len(student_heights)): + student_heights[n] = int(student_heights[n]) +print(student_heights) + + + + +total_height = 0 +for height in student_heights: + total_height = total_height = height +print(total_height) + + +num_of_student = len(student_heights) +average_height = round(total_height / num_of_student) +print(average_height) +