![]() | ![]() |
They are only two methods available for working Python tuples.
count(y)
When called will give the item numbers that are equal to y.
index(y)
When called will give index first item index that is equal to y.
Example
Start IDLE.
Navigate to the File menu and click New Window.
Type the following:
t_mine=[‘t’,’k’,’q’,’v’,’y’,’c’,’d’]
print(t_mine.count('t'))
print(t_mine.index('l'))