CMSC 201

Lab 7: Practice

Functions

Part 1

Write a function that takes a list as an argument, and returns the list reversed.

Part 2

Write a function that takes a 2D list of arguments, and returns the list with each inner list reversed. So if you call reverse([ [1, 2, 3], [4, 5, 6]]) you should get [[3, 2, 1], [6, 5, 4]]. Use the function you wrote in part 1.