Skip to content

Instantly share code, notes, and snippets.

@IndhumathyChelliah
Created July 14, 2020 00:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IndhumathyChelliah/bea922187675be13e5ccf0966dc70dbc to your computer and use it in GitHub Desktop.
Save IndhumathyChelliah/bea922187675be13e5ccf0966dc70dbc to your computer and use it in GitHub Desktop.
#tuple unpacking
t=("red","green","blue")
#ignoring value "green" while tuple unpacking
t1,_,t2=t
print (t1)#Output:red
print (t2)#Output:blue
#Ignoring multiple values in tuple unpacking
tt=(1,2,3,4,5,6)
#Ignoring all values except first and last element in tuple.
t3,*_,t4=tt
print (t3)
print (t4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment