Skip to content

Instantly share code, notes, and snippets.

@timeowilliams
Last active September 18, 2020 16:19
Show Gist options
  • Save timeowilliams/e86a7ac854f1ff34c47e835283997b7c to your computer and use it in GitHub Desktop.
Save timeowilliams/e86a7ac854f1ff34c47e835283997b7c to your computer and use it in GitHub Desktop.
Python Practice 12: First and Last
def firstAndLast(a):
c =[]
c.append(a[0])
c.append(a[-1])
print(c)
a = [3, 4, 6, 7, 9]
firstAndLast(a)
name = ['T', 'i', 'm', 'e', 'o']
firstAndLast(name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment