Skip to content

Instantly share code, notes, and snippets.

@sakekasi
Last active December 4, 2017 19:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sakekasi/3d359c26d65c21f7776590bc1ba48b9a to your computer and use it in GitHub Desktop.
Save sakekasi/3d359c26d65c21f7776590bc1ba48b9a to your computer and use it in GitHub Desktop.
mit problem 2
# 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