Put the lesson Lists into practice by writing a program yourself.
You measured the Vickers hardness of a steel sample four times: 150, 162, 158 and 149 HV. A fifth measurement just came in: 155 HV.
Add it to the list, then summarise all the measurements. Python's built-in len(), max(), min() and sum() work on lists.
155 to the end of the list with append().Measurements: 5 Highest: 162 Lowest: 149 Average: 154.8
Write your program below and press Run. Each run is checked against the expected output.
Press Run to see what your program prints.
One possible solution. Other programs that print the same output are correct too.
hardness = [150, 162, 158, 149]hardness.append(155)print(f"Measurements: {len(hardness)}")print(f"Highest: {max(hardness)}")print(f"Lowest: {min(hardness)}")print(f"Average: {sum(hardness) / len(hardness):.1f}")