Using the mapped list pattern, write a function cubes (data) that returns a list of the cubes of all the numbers in data. Your code must not modify the original list. For example: Test Result nums =...


Using the mapped list pattern, write a function cubes (data) that returns a list of the cubes of all the numbers in data.<br>Your code must not modify the original list.<br>For example:<br>Test<br>Result<br>nums = [1, 2, 4]<br>[1, 8, 64]<br>print(cubes (nums))<br>cubes_list = cubes ( [5])<br>print(cubes_list)<br>[125]<br>

Extracted text: Using the mapped list pattern, write a function cubes (data) that returns a list of the cubes of all the numbers in data. Your code must not modify the original list. For example: Test Result nums = [1, 2, 4] [1, 8, 64] print(cubes (nums)) cubes_list = cubes ( [5]) print(cubes_list) [125]

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here