Tuple Tuples are used to store multiple items in a single variable. A tuple is a collection which is ordered and unchangeable. Tuples are written with round brackets. thistuple = ("apple", "banana", "cherry") Tuple items are ordered, unchangeable, and allow duplicate values. When we say that tuples are ordered, it means that the items have a defined order, and that order will not change. Tuples are unchangeable, meaning that we cannot change, add or remove items after the tuple has been created.

Continue reading

Author's picture

Kai Li (李锴)

PhD candidate of Environmental Sciences, Leiden University

Leiden University

the Netherlands