← Back

Code Challenge 2.7 - Coin Flip Simulator


Objective

Your task is to create a program that simulates flipping a coin multiple times based on user input. The program will keep track of how many times heads and tails occur and display the counts and percentages at the end.

Skills to Practice

Challenge Tasks

Sample Output

Enter the number of times to flip the coin: 10 [Enter]
Flip 1: Heads
Flip 2: Tails
Flip 3: Heads
Flip 4: Heads
Flip 5: Tails
Flip 6: Heads
Flip 7: Tails
Flip 8: Tails
Flip 9: Heads
Flip 10: Heads

Results:
Heads: 6 (60%)
Tails: 4 (40%)