student_heights = input("Input a list of studen heights ").split()
total_height = 0
for height in student_heights:
total_height += height
print(total_height)
number_of_students = 0
for student in student_heights:
number_of_students += 1
print(number_of_students)
Im following with the teacher on a online course and I don't see what im doing wrong.
the error I am getting is
Traceback (most recent call last):
File "main.py", line 5, in <module>
total_height += height
TypeError: unsupported operand type(s) for +=: 'int' and 'str'