KnowledgeBoat Logo

Computer Science

How are individual elements of tuples accessed?

Python Tuples

1 Like

Answer

The individual elements of a tuple are accessed through their indexes given in square brackets as shown in the example below:

Example:

tup = ("python", "tuple", "computer")
print(tup[1])
Output
tuple

Answered By

1 Like


Related Questions