- Tuples are used to store multiple items in a single variable.
- Tuple is one of 4 built-in data types in Python used to store collections of data, the other 3 are List, Set, and Dictionary, all with different qualities and usage.
- A tuple is a collection which is ordered and unchangeable.
- Tuples are written with round brackets.
Tuples
mytuple = (“apple”, “banana”, “cherry”)
thistuple = ("apple", "banana", "cherry")
print(thistuple)thistuple = ("apple", "banana", "cherry", "apple", "cherry")
print(thistuple)tuple1 = ("apple", "banana", "cherry")
tuple2 = (1, 5, 7, 9, 3)
tuple3 = (True, False, False)tuple1 = ("abc", 34, True, 40, "male")mytuple = ("apple", "banana", "cherry")
print(type(mytuple))