Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#unpacking first,middle,last elements
num=(1,2,3,4,5)
first,*middle,last= num
print (first)
#Output: 1
print (middle)
#Output: [2,3,4]
print (last)
#Output: 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment