solutions

Reverse a list

Write a function that takes in a list and returns the list reversed.

reverse_a_list([1, 2, 3, 4]) == [4, 3, 2, 1]

Test Cases

test reverse a list with strings - Run Test

def test_reverse_a_list_with_strings():
    assert reverse_a_list([
        'eggs', 'flour', 'sugar', 'chocolate']) == [
            'chocolate', 'sugar', 'flour', 'eggs']

test reverse a list with ints - Run Test

def test_reverse_a_list_with_ints():
    assert reverse_a_list([1, 2, 3, 4]) == [4, 3, 2, 1]