#Purpose: simulate a number of trials of flipping a coin
#pre-conditions: number of trials
#post-conditions: reports number of heads and tails
from random import randint
def main():
howmany = int(input("How many trials "))
heads = 0 # counter for heads
tails = 0 # counter for tails
for i in range(howmany):
flip = randint(1,2) # get a coin toss
if flip == 1: # head is 1
heads += 1
else: # tail is 2
tails += 1
#report results
print("Trials", howmany)
print("Heads", heads)
print("Tails", tails)
main()