I have this function with lists that has strings in it and I have to find the second element in this list that starts with \"b\".
for example:
second_e
lst = ["b", "a", "bb"] print([i for i in lst if i.startswith("b")][1])
Output:
"bb"
Or as a function:
def func(lst): return [i for i in lst if i.startswith("b")][1]