Alert level
Turn an engine temperature into OK, WARN or CRITICAL with if, elif and else and two thresholds, check the exact boundaries, then store the level in a variable for a status line.
Start the challengePractise what this example shows with these challenges.
Turn an engine temperature into OK, WARN or CRITICAL with if, elif and else and two thresholds, check the exact boundaries, then store the level in a variable for a status line.
Start the challengeA vibration check reports WARN for a reading of 63 because its elif conditions are in the wrong order, so CRITICAL can never run. Predict it, find the dead branch, fix the order, then write a four-level chain.
Start the challengeRead a console command with input(), accept start, stop and status in any case with an if/elif chain, print Unknown command for anything else, then handle empty input and show what was typed.
Start the challengeExtend the alert check from "Alert level" so a sensor that didn't answer, None, prints NO DATA instead of crashing, without treating a real 0 as missing, then do the same for an empty field in a telemetry line.
Start the challengeChoose New Norcia, Cebreros or Malargüe from the longitude under a spacecraft with an if/elif chain of ranges, then accept longitudes from 0 to 360 and reject values that can't be longitudes.
Start the challengeRoute an uploaded file to images, telemetry or rejected by its extension with an if/elif chain and endswith(), then cope with capitals, spaces and more extensions without changing the name that is shown.
Start the challengeStuck on this example or want to go further? Ask here, or see what others asked.
Log in to ask and reply.
Separate arguments with commas. They're passed on every Run as sys.argv[1:].
Log in or create a free account to save your code and share it with a link. Your code will be waiting here when you come back.