Respuesta :
Answer:
# FIXME (1): Prompt for four weights. Add all weights to a list. Output list.
weight_one=float(input('Enter weight 1:\n'))
weight_two=float(input('Enter weight 2:\n'))
weight_three=float(input('Enter weight 3:\n'))
weight_four=float(input('Enter weight 4:\n'))
weights=[weight_one,weight_two,weight_three,weight_four]
print(weights)
# FIXME (2): Output average of weights.
average_weight=(weight_one + weight_two + weight_three + weight_four) / 4
print('Average weight:', "%.2f" % average_weight)
# FIXME (3): Output max weight from list.
weights.sort()
max_weight= weights[3]
print('Max weight:', "%.2f" % max_weight)
# FIXME (4): Prompt the user for a list index and output that weight in pounds and kilograms.
print(input('Enter a list index location (0 - 3):'))
print('Weight in pounds:', weights)
kilograms = float(weights) * 2.2
print('Weight in kilograms:')
# FIXME (5): Sort the list and output it.
weights.sort()
print(weights)
Explanation:
The code that prompt the user to enter four numbers, each corresponding to a person's weight in pounds, print the average weight and maximum value is as follows:
a = float(input("Enter weight 1: "))
b = float(input("Enter weight 2: "))
c = float(input("Enter weight 3: "))
d = float(input("Enter weight 4: "))
list1 = [a, b, c, d]
print(list1)
average_weight = round(a + b + c + d / 2, 2)
print(average_weight)
print(max(list1))
Code explanation
The code is written in python.
- The variable a, b, c, and d is used to store the users input.
- The variable list1 stores the list value of the users inputs.
- Then we print the list of the users input.
- The variable "average_weight" is used to calculate and store the average weight of the users inputs and coverts it to 2 decimal places.
- Then we print the average weight in 2 decimal places.
- Finally, we print the maximum value of the list of users input.
learn more on python here: https://brainly.com/question/15387391
![Ver imagen vintechnology](https://us-static.z-dn.net/files/d4f/9ec4405f84f5ff24ef05966483c22b4e.png)
![Ver imagen vintechnology](https://us-static.z-dn.net/files/d1d/b1c1acca74a94d95feb01b9288e8d313.png)