What would be the best way to find the index of a specified character in a list containing multiple characters?
What would be the best way to find the index of a specified character in a list containing multiple characters?
def lookallindicesof(char, list):
indexlist = []
for item in enumerate(list):
if char in item:
indexlist.append(item[0])
return indexlist
indexlist = lookllindicesof('o',mylist1)
print(indexlist)