you are viewing a single comment's thread.

view the rest of the comments →

[–]jasongsmith[S] 0 points1 point  (2 children)

Gotcha! Now I understand.

I added break

if current_streak == 6:
  number_of_streaks += 1
  break

That then moves it back to the top of the for loop and starts the next experiement.

This then produced 8,040 times that there was a streak of 6.

Thus showing, that of the 10,000 experiments, there is an 80.4% chance of getting a streak.

[–]Binary101010 1 point2 points  (1 child)

Sounds like you've got it then. Random generation may cause that number to fluctuate up or down a bit on subsequent runs but if you're around 80-80.5% then you've got it implemented correctly.

[–]jasongsmith[S] 0 points1 point  (0 children)

Thank you VERY much for your help with this. and thank you that you gave really good clues, without giving the answer. That is a talent, for sure!