• Question 3: A list can be reversed using .reverse (). However, suppose we have a list whose entries might also be lists, and those lists can further contain lists, etc., and we want to reverse ALL...


#python code
coud you provide comments and little explanation it would really help me to understand
thankyou


• Question 3: A list can be reversed using .reverse (). However, suppose we have a list whose<br>entries might also be lists, and those lists can further contain lists, etc., and we want to reverse ALL<br>the lists at all levels. Write å recursive function called total reverse that does this, returning a<br>new list with itself reversed and every list contained inside it reversed. Example output:<br>>>> L1 = [1, [3, 4], 16, [21, 42, [65, 77]], 0]<br>>>> L2 = total_reverse (L1)<br>%3D<br>>>> print(L2)<br>[0, [[77, 65], 42, 21], 16, [4, 3], 1]<br>

Extracted text: • Question 3: A list can be reversed using .reverse (). However, suppose we have a list whose entries might also be lists, and those lists can further contain lists, etc., and we want to reverse ALL the lists at all levels. Write å recursive function called total reverse that does this, returning a new list with itself reversed and every list contained inside it reversed. Example output: >>> L1 = [1, [3, 4], 16, [21, 42, [65, 77]], 0] >>> L2 = total_reverse (L1) %3D >>> print(L2) [0, [[77, 65], 42, 21], 16, [4, 3], 1]

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here