student_heights = input("Input a list of student heights ").split(" ,")
student_heights = list(map(int, student_heights))
total_heights=0
for heights in student_heights:
total_heights+=heights
num_of_students=0
for students in student_heights:
num_of_students+=1
average= total_heights / num_of_students
print(round(average))
Asked
Active
Viewed 39 times
-1
-
What's your question? Please add more details – Maxwell D. Dorliea Jul 10 '22 at 14:27
-
1What input are you entering? – 001 Jul 10 '22 at 14:27
-
2Please post the full error message, including the traceback, in the question body. Paste it as text and put it inside a code block. – Lecdi Jul 10 '22 at 14:29
-
Maybe you tried to input a floating number? See here - https://stackoverflow.com/questions/1841565/ To get quick help, it's better to provide the exact *input* next time. – Daniel Hao Jul 10 '22 at 14:43
1 Answers
0
student_heights = input("Input a list of student heights ").split(" ,") thats because you have space split(" ,") here u just need .split(",")

sandrika
- 29
- 2