How to Access Items in a Tuple?


The index number, enclosed in square brackets, can be used to retrieve Python tuple items:

Example:

Print the second item in the tuple:

thistuple = ("cranberry", "blueberry", "apricot")

print(thistuple[1])


Leave a Reply

Your email address will not be published. Required fields are marked *