Skip to content

Instantly share code, notes, and snippets.

@vikychoi
Created January 27, 2018 16:32
Show Gist options
  • Save vikychoi/7704862a5845569e00bed9c6e4fe927a to your computer and use it in GitHub Desktop.
Save vikychoi/7704862a5845569e00bed9c6e4fe927a to your computer and use it in GitHub Desktop.
List list ends
def listEnds(list_x):
b = [0,0]
b[0]= list_x[0]
b[1] = list_x[len(list_x)-1]
return b
a = [5, 10, 15, 20, 25]
array = []
array = listEnds(a)
print("Input list ", a)
print("Ends of the list ", array)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment