Объяснение:
import random
# list to store the heights of the family members
family_heights = [random.randint(150, 190) for i in range(3)]
# add the heights of all the family members
total_height = sum(family_heights)
# calculate the average height
average_height = total_height / len(family_heights)
# print the results
print("Family Heights:", family_heights)
print("Total Height:", total_height)
print("Average Height:", average_height)
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Объяснение:
import random
# list to store the heights of the family members
family_heights = [random.randint(150, 190) for i in range(3)]
# add the heights of all the family members
total_height = sum(family_heights)
# calculate the average height
average_height = total_height / len(family_heights)
# print the results
print("Family Heights:", family_heights)
print("Total Height:", total_height)
print("Average Height:", average_height)