Sign InCreate Account

Upgrade to Pro

Upgrade Now

Coding Workspace

EditorProjectsPractice QuestionsTimed Mock ExamsFlowcharts

PseudoEditor AI

Pseudocode TutorCode GeneratorCode FixerCode Converter
Back to Problems
PreviousNext

Sign in to run tests against edge cases and save your code automatically.

Problem Description

Easy

Traffic Light Simulation

File Handling & Simulation
Simulation
MOD

A traffic light repeats a 12-second cycle: - Seconds 0 to 4: `Green` - Seconds 5 and 6: `Amber` - Seconds 7 to 11: `Red` After second 11 the cycle starts again at second 0. Write a program that inputs the number of seconds `t` since the simulation started (a non-negative integer) and outputs the colour of the light at that moment. For example, at `t` = 30 the light is `Amber`.

Example Input

3

Example Output

Green

Success Rate:

0% (0 passed / 0 attempted)

Code

Draft auto-saved

Test Results

Click "Test Code" to evaluate your code against the tests.

Product

For SchoolsOverviewFeaturesFAQ
PseudoEditor

© 2026 PseudoEditor. All rights reserved.