Nov-21-2020, 04:59 AM
Elements are numbered starting from zero. So the first element of a tuple is element 0.
>>> t = ("first", "second", "third", "fourth", "fifth") >>> t[0] 'first'Then once you decide which ones are pulled out, you can put them in a new tuple and return that.
>>> new_tuple = (t[0], t[1], t[0]) >>> new_tuple ('first', 'second', 'first')