Created
January 27, 2018 16:32
-
-
Save vikychoi/7704862a5845569e00bed9c6e4fe927a to your computer and use it in GitHub Desktop.
List list ends
This file contains 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 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