#coinflips.py import random flips = int(input("Input the number of flips to do: ")) heads = tails = 0 for flipNum in range(flips): if random.choice([0,1]) == 0: #randomly 0 or 1 print("H") heads += 1 else: print('T') tails += 1 print("Number of heads:", heads, " Number of tails:", tails) print("Heads %", (heads/flips*100), " Tails %", (tails/flips*100)) #all Hs and Ts on one line #Display only if user had said y.