Module 5 - Section 2 - Mouse control
5.2.1 - Tuples
Tuples are very similar to lists, except that they are immutable (they cannot be changed). Also, they are created using parentheses, rather than square brackets.
>>> breakfast = ("spam", "eggs", "milk")
As with lists we can access the values in the tuple with their index:
>>> print (breakfast)
But we cannot reassign a value in a tuple. If we try python causes an error:
>>> breakfast = "yougurt"
Tuples can be created without parentesis, by just separating the values with commas:
>>> my_tuple = "biscuits", "soda", "ice cream"
>>> print (my_tuple)
An empty tuple is created using an empty parentesis pair :
>>> tpl = () # But ..... what is the use of an empty tuple