Tuple in Python

 



# tuple is data type that can store
# only immutable values(mean to say tuple values not change)
mytp = ("hello""this" , "is")
print(mytp)
# tuple for one element
tp = (1,)
print(tp)


#   Swap two items
= 10
= 12
# IN NORMAL WAY 
# tmp = a
# a = b 
# b = tmp
# IN PYTHON
a , b = b , a
print(a , b)

Comments