Write a function convert_to_millimetres(measurements) which takes a list of measurements in centimetres as a parameter and modifies that list by replacing each measurement with its millimetres...


Write a function convert_to_millimetres(measurements) which takes a list of measurements in centimetres as a parameter and modifies that list by<br>replacing each measurement with its millimetres version, which involves multiplying by 10.<br>You will need to use the updated-list pattern. (Note that there's no need to return anything because the function modifies the original list it was<br>given.)<br>For example:<br>Test<br>Result<br>measurements = [10.0, 25.0, 1.0]<br>[30.0, 75.0, 3.0]<br>convert_to_millimetres (measurements)<br>print (measurements)<br>Answer: (penalty regime: 0, 10, ... %)<br>1def convert_to_millimetres(measurements):<br>for i in range(len(measurements)):<br>measurements[i] = measurements[i] * 10<br>return measurements<br>3<br>6<br>measurements = [10.0, 25.0, 1.0]<br>8 convert_to_millimetres(measurements)<br>9 print(measurements)<br>Precheck<br>Check<br>Test<br>Expected<br>Got<br>[30.0, 75.0, 3.0] [100.0, 250.0, 10.0] x<br>[100.0, 250.0, 10.0]<br>measurements = [10.0, 25.0, 1.0]<br>convert_to_millimetres(measurements)<br>print (measurements)<br>Some hidden test cases failed, too.<br>Your code must pass all tests to earn any marks. Try again.<br>Show differences<br>Incorrect<br>Marks for this submission: 0.00/1.00. This submission attracted a penalty of 0.10.<br>

Extracted text: Write a function convert_to_millimetres(measurements) which takes a list of measurements in centimetres as a parameter and modifies that list by replacing each measurement with its millimetres version, which involves multiplying by 10. You will need to use the updated-list pattern. (Note that there's no need to return anything because the function modifies the original list it was given.) For example: Test Result measurements = [10.0, 25.0, 1.0] [30.0, 75.0, 3.0] convert_to_millimetres (measurements) print (measurements) Answer: (penalty regime: 0, 10, ... %) 1def convert_to_millimetres(measurements): for i in range(len(measurements)): measurements[i] = measurements[i] * 10 return measurements 3 6 measurements = [10.0, 25.0, 1.0] 8 convert_to_millimetres(measurements) 9 print(measurements) Precheck Check Test Expected Got [30.0, 75.0, 3.0] [100.0, 250.0, 10.0] x [100.0, 250.0, 10.0] measurements = [10.0, 25.0, 1.0] convert_to_millimetres(measurements) print (measurements) Some hidden test cases failed, too. Your code must pass all tests to earn any marks. Try again. Show differences Incorrect Marks for this submission: 0.00/1.00. This submission attracted a penalty of 0.10.

Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here