Home / Expert Answers / Computer Science / using-python-nbsp-write-a-program-for-flipping-a-coin-10-000-times-and-store-the-results-in-a-list-pa566

(Solved): Using Python Write a program for flipping a coin 10,000 times and store the results in a list. ...



Using Python Write a program for flipping a coin 10,000 times and store the results in a list. After which, identify the number of streaks. (Streak - a series of 5 or more heads or tails) (20) Hint: use random.randint() function to create the coin flip.



We have an Answer from Expert

View Expert Answer

Expert Answer


import random result = [] for i in range(10000): result.append(random.randint(0,1)) streak = 0 for i in range(len(result)-4): if result[i] == result[i+1] == result[i+2] == result[i+3] == result[i+4]: stre
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe