Created
July 30, 2017 10:50
-
-
Save rostyq/14046b24ec718bb1f4b6ed6d284a8eab to your computer and use it in GitHub Desktop.
Exercise on www.practicepython.org
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_list_ends(input_list): | |
""" | |
Return the first and last item of list. | |
:param input_list: | |
:return list_ends: | |
""" | |
return [input_list[0], input_list[-1]] | |
a = [5, 10, 15, 20, 25] | |
print(get_list_ends(a)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment