divider

Objective

Ask the user to enter a color (red, yellow, green). Use conditionals to print what the light means.

Skills to Practice

  • icon Evaluating Boolean expressions
  • icon Branching with Selection Statements
divider

Tasks

  • icon Create a new project named sprint-2-2
  • icon Complete the following tasks:
    • icon Prompt the user to enter one of the traffic light colors.
    • icon Using selection statements, display the corresponding message from the list below.
      • icon green: "Go! 🟢"
      • icon yellow: "Prepare to stop! 🟡"
      • icon red: "Stop! 🔴"
divider

Sample Output

Sample Output
Enter a traffic light color: green
Go! 🟢

Begin Challenge