Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 030_list_indexing.py #16

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions 030_list_indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

def get_first_item(the_list):
# Return the first item of the list
pass
return the_list[0]

check_that_these_are_equal(
get_first_item(["a", "b", "c", "d", "e"]),
Expand All @@ -42,7 +42,7 @@ def get_first_item(the_list):

def get_last_item(the_list):
# Return the last item of the list
pass
return the_list[-1]

check_that_these_are_equal(
get_last_item(["a", "b", "c", "d", "e"]),
Expand All @@ -61,7 +61,7 @@ def get_last_item(the_list):

def get_nth_item(the_list, n):
# Return the item of the list at the specified index
pass
return the_list[n]

check_that_these_are_equal(
get_nth_item(["a", "b", "c", "d", "e"], 3),
Expand All @@ -81,7 +81,7 @@ def get_nth_item(the_list, n):
def get_items_between_one_and_three(the_list):
# Return the section of the list between indexes one
# and three
pass
return the_list[1:3]

check_that_these_are_equal(
get_items_between_one_and_three(["a", "b", "c", "d", "e"]),
Expand Down