In this tutorial you will learn about the Python Tuple and its application with practical example.
Python Tuple
In Python, Tuple is an ordered sequence of comma-separated values (items or elements). Tuples are same as list, but the only difference is that tuples are immutable. Once a tuple is created their elements and size can not be changed. A Tuple is defined within parentheses () where items are separated by commas.
Example:-
1 2 |
t1 = ('sun','mon', 'tue') print t1 |
Output:-
1 |
('sun', 'mon', 'tue') |