I have a list like this but with thousands or maybe millions of elements:
test = [
("goodbye", "help", "buy","sell", "1.1.1.1", 25),
("hi dude", "text", "friends","love", "blablabla", 14),
("hi darling", "books", "letter","class", "club", 64)
]
What would be the most optimized code for finding all the elements indexes that contain the word "hi"?
In the given example above, it should return test[1]
and test[2]
.