Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- def game(ra, rb):
- prob_a = ra / (ra + rb)
- points_a = 0
- points_b = 0
- winning_score = 11
- while points_a < winning_score and points_b < winning_score:
- prob = random.random()
- if prob < prob_a:
- points_a += 1
- else:
- points_b += 1
- return(points_a, points_b)
- game(70,30)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement