Skip to content

Instantly share code, notes, and snippets.

@rostyq
Created July 30, 2017 10:50
Show Gist options
  • Save rostyq/14046b24ec718bb1f4b6ed6d284a8eab to your computer and use it in GitHub Desktop.
Save rostyq/14046b24ec718bb1f4b6ed6d284a8eab to your computer and use it in GitHub Desktop.
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