Results for “comparison”

9 results

  1. Challenge

    Flag from config text

    …you added before you check. Modify. Work dry_run out by comparing the text with "True" , so it is a real True or False. With the config saying "False" it must print: Firing the main engine Make…

    Fix the code Easy 3 stages bool if else config
  2. 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
  3. Challenge

    Manifest diff

    Compare yesterday's and today's cargo IDs with set difference to print what was added and what was removed, then count what stayed with an intersection and print none for an empty change.

    Write the code Easy 2 stages sets difference intersection sorted
  4. Challenge

    Missing reading

    …sensor didn't answer and temperature_c is None . Run it: comparing None with a number stops with a TypeError . Check for None first, so it prints: ENG-2: NO DATA Use temperature_c is None , and move…

    Write the code Medium 2 stages if else None is None
  5. Challenge

    Launch schedule digest

    …, returning the parsed datetime, works for the comparison and as the key for sorted() . strftime("%Y-%m-%d %H:%M") formats a datetime. Time left, and holds Add the time left to each launch, as days…

    Write the code Medium 3 stages project json datetime timedelta
  6. Challenge

    Clear error messages

    …and the function stops with a confusing TypeError from the comparison. Check the type first and raise your own TypeError , naming the type that came in: 500.0 Refused: burn length can't be negative…

    Write the code Medium 2 stages errors raise ValueError TypeError
  7. Challenge

    Manifest validator

    …Check the type with isinstance(mass, (int, float)) before comparing it. Duplicates and the total load Two things one item can't know about itself: whether its ID was already used, and whether the…

    Write the code Medium 2 stages project validation dictionaries functions
  8. Challenge

    Validate a cargo record

    …problems at the end. Check that "mass_kg" is there before comparing it. The ID format Cargo IDs have a fixed format: CG- followed by exactly four digits. Add bad ID format to the problems when the ID…

    Write the code Medium 2 stages functions return lists validation