Last active
December 4, 2017 19:03
-
-
Save sakekasi/3d359c26d65c21f7776590bc1ba48b9a to your computer and use it in GitHub Desktop.
mit problem 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Implement a function that meets the specifications below. | |
def deep_reverse(L): | |
""" | |
assumes L is a list of lists whose elements are ints. | |
returns a new list that reverses L's elements and also | |
reverses the order of the int elements in every element of L. | |
""" | |
# Your code here | |
pass | |
example1 = deep_reverse([[1,2],[3,4],[5,6,7]]) # returns [[7,6,5],[4,3],[2,1]] | |
example2 = deep_reverse([]) # returns [] | |
example3 = deep_reverse([[1],[3,4,5]]) # returns [[5,4,3],[1]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment