A tuple is a collection that cannot be modified.
Variables can be of the datatype tuple. A tuple is defined using parenthesis.
If you want to change the data during program execution, use a list instead of a tuple.
A tuple with one item ( a comma is needed in the end ):
x = (1,)
x = (1,2,3,4)
To access individual elements, we use square brackets. To print the first element (Python starts counting from zero):
You can access tuples both in the interpreter and during code execution.
To print the last element, you can count from the back using the minus sign.