meta data for this page
  •  

This is an old revision of the document!


tuples

Store multiple items in a single variable. Tuple:

  • ordered (has index)
  • allow duplicated (index is unique)
  • immutable
  • can contain different data types
# create tuple
a = ( 1, "a", True )
 
# create tuple with one item NOTE: comma after item
a = ( 1, )