Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
num=(1,2,3,4,5)
#unpacking last element vs rest
*rest,last= num
print (rest)
#Output: [1,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