Задание на языке программирования Python
Найти средний рост учеников в классе. Известно, что учеников 25 человек, рост вводится пользователем с клавиатуры.
Помогите написать программу, кто разбирается, пожалуйста
Ответы на вопрос
Ответил flash77779
0
# initialize variables
total_height = 0
num_students = 25
# loop over each student and prompt the user to enter their height
for i in range(num_students):
height = float(input(f"Enter height of student {i+1}: "))
total_height += height
# calculate the average height
average_height = total_height / num_students
# display the average height
print(f"The average height of the class is {average_height:.2f}")
Приложения:

Новые вопросы