Tuple Data Type in Python

 

Concept



Tuple is a collection which is immutable, ordered and unchangeable. Allows duplicate members



Code Example



Example 1:

>>> t = ()
>>> t
()

>>> type(t)
<class 'tuple'>

>>> t = (10, 20.35, 'Hello', [1, 2])
>>> t
(10, 20.35, 'Hello', [1, 2])


Example 2:

>>> t = (10, 20.35, 'Hello', [1, 2])
>>> len(t)
4




Get Help

Comments

Popular posts from this blog

How To Create .ENV File in Python

Create a Large file for Test Data Processing using Python

How to solve the Liner Equation using Python