0
How to get index a bool type value in a list
How is the best way for to get index in python list when the value is boolean. Example: list = ["test", 6, "Guitar", True, 97, False]
2 odpowiedzi
+ 1
list = ["test", 6, "Guitar", True, 97, False]
index = [list.index(x) for x in list if type(x)==bool]
print(index)