Results for “and”

Showing 21–30 of 150

  1. Challenge

    Shadowed fuel

    …to fuel_kg inside the function, creating a local variable and leaving the global fuel unchanged. Predict the last line, compare both values, fix it by returning the total, then write a function that…

    Fix the code Medium 3 stages functions scope local variables global variables
  2. Challenge

    Sort by a field

    Sort launches by date with sorted() and a small function that returns each launch's date, then sort the cargo manifest heaviest first with a key function and reverse=True.

    Write the code Easy 2 stages functions sorted key reverse
  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

    Print the manifest

    …of dicts, one per item, with an ID, a name, a category and a mass. The loading crew wants it printed, one line per item, with the total at the bottom. Every item Print one manifest line for every…

    Write the code Easy 2 stages dictionaries lists of dicts for loop formatting
  5. Challenge

    Line to record

    …it stores every reading as a dict with time, sensor, value and unit in a list of records, then let other code pick out one sensor's readings by key.

    Write the code Easy 2 stages dictionaries lists parsing records
  6. Challenge

    Nested response

    Print the rocket's name and the first mission patch URL from a nested launch response by chaining keys and indexes, then add the operator and orbit and cope with a launch that has no patches yet.

    Write the code Easy 2 stages dictionaries nested data lists JSON
  7. Challenge

    Flag from config text

    …dry_run is False, yet bool("False") turns it into True and the engine simulates instead of firing. Predict it, find out why, compare the text instead, then read yes/no settings typed by hand.

    Fix the code Easy 3 stages bool if else config
  8. Challenge

    Validate a command

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

    Write the code Easy 2 stages if elif else input