This article is in continuation of the article series "Jump Start with Python." To read previous articles please refer to the links below:
Now, let's start with part 7 of this article series, we will be discussing tuples in python.
Tuples are immutable lists. Tuples in Python can be written as comma-separated values (items) enclosed between parentheses irrespective of their type. Tuples are similar to lists only difference is that it cannot be changed in any way once it is created. This is example of simple tuple in Python:

Syntax: tuple_name=(item1, item2, item3, ---- , itemn)

Some facts about tuples:
- Declaring zero and one element tuple:
If empty parentheses are assigned to a variable then it is termed as zero element tuple.Syntax: tuple_name=()One element tuple is declared in Python using the following syntax:Syntax: tuple_name=("item1", )
- In Python, any set of elements that are declared as comma-separated values (items) are considered as tuples.
- Indexes for tuples start from 0. Positive indexes start from left to right while negative indexes start from right to left.
- Python also supports slicing index in Tuples which allows accessing multiple elements of tuple at once. Below is an example of slicing in tuples.
Syntax: tuple_name(start_index: end_index)

Sub-tuples
A tuple in Python can have tuples as elements, these sub-tuples may further contain tuple elements as well. Tuples can be recursively created by many sub-tuple structures. Below is an example of a sub-tuple in Python.












Ehsan SajjadPosted Feb 5, 2016, 12:15 PM
Good Series
Shubham KumarPosted Feb 4, 2016, 1:57 AM
nice
Santhakumar MunuswamyPosted Feb 3, 2016, 3:01 PM
Thanks for nice share
Sibeesh VenuPosted Feb 3, 2016, 12:35 AM
Nice Share
Mohammed IbrahimPosted Feb 2, 2016, 2:12 PM
nice
Debasis SahaPosted Feb 2, 2016, 9:50 AM
Good One..