Tuples

Tuples

Tuples are almost the same as lists but once the values are declared they can not be changed which means they are immutable. They are declared by brackets (). Trying to make changes in tuples gives you an error.

--------------------------------

Code: -

mytuple = ("python",9,"is",True,"awesome")

print(mytuple[0],mytuple[1],mytuple[2])

Output: -

python is awesome

-----------------------------------


Comments

Post a Comment

Popular posts from this blog

Comments

#1- Let's Learn Python In the least possible time

Dictionaries