Computers and Technology

In python

(1) prompt the user to enter four numbers, each corresponding to a person's weight in pounds. store all weights in a list. output the list. (2 pts)

ex:

enter weight 1:
236.0
enter weight 2:
89.5
enter weight 3:
176.0
enter weight 4:
166.3
weights: [236.0, 89.5, 176.0, 166.3]
(2) output the average of the list's elements with two digits after the decimal point. hint: use a conversion specifier to output with a certain number of digits after the decimal point. (1 pt)

(3) output the max list element with two digits after the decimal point. (1 pt)

ex:

enter weight 1:
236.0
enter weight 2:
89.5
enter weight 3:
176.0
enter weight 4:
166.3
weights: [236.0, 89.5, 176.0, 166.3]

average weight: 166.95
max weight: 236.00
(4) prompt the user for a number between 1 and 4. output the weight at the user specified location and the corresponding value in kilograms. 1 kilogram is equal to 2.2 pounds. (3 pts)

ex:

enter a list index location (1 - 4):
3
weight in pounds: 176.00
weight in kilograms: 80.00
(5) sort the list's elements from least heavy to heaviest weight. (2 pts)

ex:

sorted list: [89.5, 166.3, 176.0, 236.0]

answer
Answers: 3

Similar questions

Do you know the correct answer?
In python

(1) prompt the user to enter four numbers, each corresponding to a person's we...

Questions in other subjects: