This file contains hidden or 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 | |
flips = int(input('how many times do you want to flip the coin? ')) | |
outcomes = ['head','tail'] | |
wieghts = [.5,.5] | |
head=0 | |
tail=0 | |
for flip in range(flips): | |
h_t = random.choice(outcomes) | |
if h_t == 'head': | |
head += 1 |
This file contains hidden or 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 | |
deck = [] | |
hand = [] | |
card = None | |
score = 0 | |
with open('deck.txt', 'r') as d: | |
for line in d: | |
deck.append(line.strip('\n')) | |
random.shuffle(deck) |