23
23
24
24
def get_first_item (the_list ):
25
25
# Return the first item of the list
26
- pass
26
+ return the_list [ 0 ]
27
27
28
28
check_that_these_are_equal (
29
29
get_first_item (["a" , "b" , "c" , "d" , "e" ]),
@@ -42,7 +42,7 @@ def get_first_item(the_list):
42
42
43
43
def get_last_item (the_list ):
44
44
# Return the last item of the list
45
- pass
45
+ return the_list [ - 1 ]
46
46
47
47
check_that_these_are_equal (
48
48
get_last_item (["a" , "b" , "c" , "d" , "e" ]),
@@ -61,7 +61,7 @@ def get_last_item(the_list):
61
61
62
62
def get_nth_item (the_list , n ):
63
63
# Return the item of the list at the specified index
64
- pass
64
+ return the_list [ n ]
65
65
66
66
check_that_these_are_equal (
67
67
get_nth_item (["a" , "b" , "c" , "d" , "e" ], 3 ),
@@ -81,7 +81,7 @@ def get_nth_item(the_list, n):
81
81
def get_items_between_one_and_three (the_list ):
82
82
# Return the section of the list between indexes one
83
83
# and three
84
- pass
84
+ return the_list [ 1 : 3 ]
85
85
86
86
check_that_these_are_equal (
87
87
get_items_between_one_and_three (["a" , "b" , "c" , "d" , "e" ]),
0 commit comments