17
loading...
This website collects cookies to deliver better user experience
list.index(element, start, end)
data_types = ["Str", "Int", "Float"]
# Searching for “int”
print(data_types.index("Int"))
#Output - 1
vowels = ['a', 'e', 'i', 'o', 'i', 'u']
# Searching for “o” within index 1-5
print(vowels.index("o",1,5))
#Output - 3
# Searching for “o” within index 1-3
print(vowels.index("o",0,2))
#Output - ValueError: 'o' is not in list