Flip a coin as many times as the user asks, then report how many heads and tails came up and what percentage each was.
Heads or Tails was a game. This is an experiment — the interesting part is whether 1000 flips really do land near 50/50. Try it and find out.
range()Once it works, run it with 10 flips, then 100, then 1000. The percentages should settle closer to 50/50 the more flips you do.
Enter the number of times to flip the coin: 10 [Enter]Flip 1: HeadsFlip 2: TailsFlip 3: HeadsFlip 4: HeadsFlip 5: TailsFlip 6: HeadsFlip 7: TailsFlip 8: TailsFlip 9: HeadsFlip 10: Heads
Results:Heads: 6 (60.0%)Tails: 4 (40.0%)