⌘K
Flycodx

Air Quality Index Status String Builder

Air Quality Index Status String Builder

EasyStrings100% accepted

An air quality monitoring network in Mumbai builds status strings from AQI (Air Quality Index) readings. Each status string includes city name, AQI value, health status, and color code. The mapping is: 0-50='Good'/'Green', 51-100='Moderate'/'Yellow', 101-200='Poor'/'Orange', 201+='Severe'/'Red'.

Approach

Given a city name and AQI index value in format 'CityName,AQI', construct a status string 'CityName:AQI:Status:ColorCode' where Status and ColorCode are determined by AQI ranges.

Input

Mumbai,45

Output

Mumbai:45:Good:Green
solution.py
Loading editor...
Test 1
Test 2
Test 3

Press Run to test your custom input, or Submit to judge against all test cases.

Sign in to continue

Create a free account to run code, submit solutions and track progress.

  • Free forever — no credit card
  • 10+ languages with live execution
  • Points, streaks & leaderboards
Auto Save OnLn 1, Col 1Spaces: 4UTF-8LFPython 3