I have a tuple in python (\'A\',\'B\',\'C\',\'D\',\'E\'), how do I get which item is under a particular index number?
Example: Say it was given 0, it would return A
You can use _ _getitem__(key) function.
>>> iterable = ('A', 'B', 'C', 'D', 'E') >>> key = 4 >>> iterable.__getitem__(key) 'E'