Python : What is tuple in Python

Basic definition : Tuple is a read only list. Its elements cannot be re assigned nor its size can be altered / changed (as we do in lists), and all other operation like slicing, iteration, concatenation can be done in a similar way as lists.

A tuple is a sequence of immutable Python objects. Tuples are sequences, just like lists. The differences between tuples and lists are, the tuples cannot be changed unlike lists and tuples use parentheses, whereas lists use square brackets.

Creating a tuple is as simple as putting different comma-separated values. Optionally you can put these comma-separated values between parentheses also. For example −