from __future__ import division, print_function
import random
balls = ['R', 'R', 'R', 'B']
two_red = 0
one_red = 0
for i in xrange(10000):
balls_taken = random.sample(balls, 2)
looked_at = random.choice(balls_taken)
if looked_at == 'B':
continue
elif balls_taken.count('R') == 2:
two_red += 1
else:
one_red += 1
print('Times we took two red and looked at a red ball:', two_red)
print('Times we took one red and looked at a red ball:', one_red)
print('Probability the other ball is red:', two_red / (one_red + two_red))