#-----------------------------------------------------------------------
# FairCoin2.py
#
# Simulates n flips of a fair coin.
#
#-----------------------------------------------------------------------
from random import random


n = 5         # number of flips to perform
results = []  # list of outcomes

# perform n flips
for i in range(n):

   # perform one flip
   x = random() # get a random number in [0.0, 1.0)
   outcome = "H" if x<0.5 else "T"

   # add outcome to results
   results.append(outcome)

# end while

# print results
print()
print("   results =", results)
print()

