Results for “if”

Showing 1–10 of 63

  1. Challenge

    Flatten nested ifs

    Refactor a docking check built from three nested ifs into one condition joined with and, keeping the output exactly the same, then rewrite it as a flat if/elif chain that reports the first check that…

    Fix the code Medium 2 stages if elif and nested conditions
  2. Challenge

    Launch commit criteria

    Clear a launch only if the wind is under 30 km/h, there is no lightning and range safety reports GO, using and and not, then print every rule that is holding the launch.

    Write the code Easy 2 stages if else and not
  3. Challenge

    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.

    Write the code Easy 2 stages if elif else comparisons
  4. Challenge

    Validate a command

    …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.

    Write the code Easy 2 stages if elif else input
  5. Challenge

    Check every reading

    Extend the OK/WARN/CRITICAL check from Alert level so a for loop runs it over every temperature in a list, then count the WARN and CRITICAL readings for a summary line.

    Write the code Easy 2 stages for loop lists if elif
  6. Challenge

    Ground station pick

    …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.

    Write the code Easy 2 stages if elif else ranges
  7. Challenge

    Safe mode

    …name the rule that fired with boolean variables and an if/elif chain.

    Write the code Medium 2 stages if elif or and
  8. Challenge

    Upload router

    …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.

    Write the code Easy 2 stages if elif else or
  9. Challenge

    Flag from config text

    …The config says "False". Follow it through bool() and the if . Investigate and modify Investigate. Find out what bool("False") and bool("") give and store the answers, True or False , in the two…

    Fix the code Easy 3 stages bool if else config