-
-
Save IndhumathyChelliah/bea922187675be13e5ccf0966dc70dbc to your computer and use it in GitHub Desktop.
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
#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