Skip to content

Tuples

Python Tuples

Tuples are like lists but can't be changed. Tuples are faster than lists, so if you're doing something on a large scale it might be worth using a tuple. Tuples are created using parentheses. Also might use if you create that you don't want the user to change.

names = ("John", "Bob", "Mary")
print (names[0]) # prints John