p_heads = 1 / 2 p_six = 1 / 6 # The coin flip has no effect on the die roll -> independent events p_heads_and_six = p_heads * p_six print(f"P(heads and rolling a 6) = {p_heads_and_six:.4f}") # Output: # P(heads and rolling a 6) = 0.0833
Click Run to execute this code.