Data Science, Statistics, Probability, Data Analytics, Data Science Interview.
built-in itertools method — filterfalse() to pass a lambda expression for this. favorable_flips = [flip_outcome for flip_outcome in flips_5 if len(list(itertools.filterfalse(lambda x : x !='T', flip_outcome))) == 2] favorable_flips [('H', 'H', 'H', 'T', 'T'), ('H', 'H', 'T', 'H', 'T'), ('H', 'H',