← Back

Code Challenge 2.6 - Heads or Tails 🪙


Objectives

Your task is to create a program that lets the user play a game of Heads or Tails. Along with the core game, your program should keep track of wins and losses, and ask the user if they want to play again.

Skills to Practice

Challenge Tasks

Sample Output

Welcome to Heads or Tails! 🪙
Guess the outcome (heads/tails): heads [Enter]
It's heads! You win!
Wins: 1 | Losses: 0

Do you want to play again? (yes/no): yes [Enter]

Guess the outcome (heads/tails): tails [Enter]
It's heads! You lose.
Wins: 1 | Losses: 1

Do you want to play again? (yes/no): no [Enter]

Thanks for playing! Final score: Wins: 1 | Losses: 1