Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Accessing of Tuples in python

#Accessing Tuple
#with Indexing
Tuple1 = tuple("Softhunt")
print("
First element of Tuple: ")
print(Tuple1[1])
 
 
#Tuple unpacking
Tuple1 = ("Python", "Softhunt", "Tutorials")
 
#This line unpack
#values of Tuple1
a, b, c = Tuple1
print("
Values after unpacking: ")
print(a)
print(b)
print(c)
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #Accessing #Tuples #python
ADD COMMENT
Topic
Name
9+6 =