You can start with a blank tuple with something like t = ()
. You can add with +
, but you have to add another tuple. If you want to add a single element, make it a singleton: t = t + (element,)
. You can add a tuple of multiple elements with or without that trailing comma.
>>> t = ()>>> t = t + (1,)>>> t(1,)>>> t = t + (2,)>>> t(1, 2)>>> t = t + (3, 4, 5)>>> t(1, 2, 3, 4, 5)>>> t = t + (6, 7, 8,)>>> t(1, 2, 3, 4, 5, 6, 7, 8)