Panhary H.

asked • 02/28/23

Write a function nested_double(nested_list)

Exercise 7-2

Write a function nested_double(nested_list) that takes in a list of lists of integers, and returns the list with every integer doubled. You can choose to either create a new list or alter the original.


Submit your code to gradescope in a file called ex7-2.py.


Examples:

>>> nested_double([[0, 3], [], [2, 5, -10], [-9, 13, 12, 2]])

[[0, 6], [], [4, 10, -20], [-18, 26, 24, 4]]


>>> nested_double([])

[]


>>> nested_double([[1, 2, 3], [4, 5, 6], [7, 8, 9]])

[[2, 4, 6], [8, 10, 12], [14, 16, 18]]



1 Expert Answer

By:

Muhammad Usman S. answered • 02/28/23

Tutor
New to Wyzant

I have a diverse range of tutoring skills and expertise

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.