Created
June 22, 2019 14:30
-
-
Save pi314/ef58dbed6e182abf4bd695ed8d544910 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
def main(): | |
results = {} | |
results['OO'] = 0 | |
results['OX'] = 0 | |
results['XO'] = 0 | |
results['XX'] = 0 | |
for i in range(10000): | |
A = random.choice(['O', 'X']) | |
B = random.choice(['O', 'X']) | |
if A == 'O' and B == 'O': # the question said this combination *didn't* happen | |
continue | |
results[A+B] += 1 | |
print(results) | |
# {'OO': 0, 'OX': 2479, 'XO': 2457, 'XX': 2556} | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment