Your question is Probability in Independent Sequences. Take a moment with it on the right.
Talk me through your thinking if you like. When you're confident, submit your answer and I'll grade it like a real screen (7/10 or better passes).
Explain the probability of a specific outcome in a sequence of independent events.
Assume each event is an independent Bernoulli trial with common success probability p. Given p and an ordered sequence of successes and failures, calculate the probability that the exact sequence occurs, show the calculation, and provide a reusable implementation.
Use the function signature probability_of_sequence(p, outcomes), where p is a success probability and outcomes is an ordered Boolean sequence. Return the probability of that exact sequence.