Results for “python loops”

Showing 41–50 of 57

  1. Challenge

    Validate a cargo record

    …in that order, and negative mass for a mass below 0. The loop at the bottom then prints: CG-0042: OK CG-0043: missing item, negative mass CG-0044: missing mass_kg CG-42: OK Start with problems = []…

    Write the code Medium 2 stages functions return lists validation
  2. Challenge

    Real JSON

    …came in one batch, and the second was cut off in transfer. Loop over responses , print one line per launch, and print a message instead of crashing for the broken one: Lumen-3 (JAXA): Go Bad response…

    Write the code Easy 2 stages json json.loads modules import
  3. Challenge

    Telemetry from CSV

    …and its feed string: open telemetry.csv with newline="" , loop over csv.DictReader(csv_file) , and print each row in the same format as before: 09:30:05 ENG-2: 412.5 C 09:30:05 TANK-1: 78.3 % 09:30:10…

    Write the code Medium 2 stages csv csv.DictReader files open
  4. Challenge

    Go launches only

    …Lumen-3 (JAXA) Tern-5 (ISRO) Aurora Relay 2 (JAXA) Loop over the launches and compare launch["status"] with "Go" . And the rest Collect the launches that aren't Go, each with its status, and print…

    Write the code Easy 2 stages dictionaries lists of dicts filtering if
  5. Challenge

    Legacy script

    …is over 450, otherwise OK . Then print the report with a loop over a list of the engines. The output, before and after: ENGINE REPORT ============= ENG-1 avg 425.6 max 431.75 OK ENG-2 avg 400.4 max…

    Fix the code Hard 2 stages project refactoring functions testing
  6. Challenge

    Log analyser

    …ERROR: 10:14:47 PROP Fuel valve 2 not responding Stop the loop with break as soon as you find it. The hidden tests also run a log without any errors. Rank by warnings Rank the subsystems by how many…

    Write the code Hard 3 stages project logs parsing Counter
  7. Challenge

    Manifest validator

    …was already used, and whether the whole load fits. In the loop, add "duplicate id" to an item's problems when its ID was seen before, keep a count and the mass of the items that pass, and finish with…

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

    Extra log fields

    …after msg . Inside, fields is a dict: build the line, then loop over fields.items() and add to it. Fields from dicts The fields often come ready in dicts. Pass them as keyword arguments with **…

    Write the code Medium 2 stages functions **kwargs keyword arguments dictionaries
  9. Challenge

    Extract a function

    …= {"A": waypoint_a, "B": waypoint_b, "C": waypoint_c} , loop over it to print each distance, and print the nearest one at the end: To waypoint A: 193.0 km To waypoint B: 323.3 km To waypoint C: 7.7 km…

    Fix the code Easy 2 stages functions refactoring return tuples