Creation and use of tuples in Python

To make easy the explanation of tuples, we can compare them with lists, this lists called tuples have something different, the items that are inside the tuple can not be changed, all the items that are inside are going to stay there as they where typed when the tuple was created. To create a tuple, you just have to type the name of the tuple followed by an equal and then between parenthesis the items that are going to be inside the tuple, separated each one with a comma and between quotation marks, for example: name = (“Jorge”, “Padilla”)

CC BY 4.0 Creation and use of tuples in Python by Jorge Padilla is licensed under a Creative Commons Attribution 4.0 International License.

Comments are closed.