Python Tuples

Description

  • Very similar to lists
  • Tuples are immutable, so that means they can't be change the values.
  • We use parenthesis instead of brackets.
  • Tuple will be separated by commas.
  • Tuples have heterogeneous elements, so they can be from any type. example:
>>> myTuple = ('text', 2, a['1',0,'blah'])
>>> myTuple
('text', 2, a['1',0,'blah'])
  • We can omit the wrapping delimiters