Answers for "searching in a tuple python"

0

searching in a tuple python

# vowels tuple
vowels = ('a', 'e', 'i', 'o', 'i', 'u')

# element 'e' is searched
index = vowels.index('e')

# index is printed
print('The index of e:', index)

# element 'i' is searched
index = vowels.index('i')

# only the first index of the element is printed
print('The index of i:', index)
Posted by: Guest on February-25-2020

Python Answers by Framework

Browse Popular Code Answers by Language