Results for “end”

Showing 51–60 of 75

  1. Challenge

    Extract a function

    …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 Nearest: C (7.7 km) Call distance_km() once per waypoint, and…

    Fix the code Easy 2 stages functions refactoring return tuples
  2. Challenge

    Parser function

    …strips the line, so spaces around a good line don't end up in its fields, and returns None for a blank line, a comment, or a line that doesn't have exactly four fields. The loop just keeps whatever…

    Fix the code Medium 2 stages functions return dictionaries None
  3. Challenge

    Silent branch

    …Python printed. Follow "Scrub" through the function to its end. Investigate and modify Investigate. Store what status_light("Scrub") and status_light("TBD") give back, as text, in scrub_gives and…

    Fix the code Easy 3 stages functions return None branches
  4. Challenge

    Test the alert levels

    …and 450, and 399.9 and 449.9. Keep the passed line at the end. The hidden tests now break the function the way people really do: > instead of >= , or a threshold off by one.

    Write the code Medium 2 stages testing assert functions boundaries
  5. Challenge

    Validate a cargo record

    …, append each problem you find, and return 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…

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

    Entries per level

    At the end of every orbit the flight director gets one line about the log: how many entries of each level it had. A sudden jump in warnings says more than any single entry. Count the entries per…

    Write the code Easy 2 stages dictionaries counting get sorted
  7. Challenge

    Crew roster

    …is always first, and whoever joined last is at the end. The mission board shows who is in charge, who is newest and how many people are on board. Read those facts out of the list, then add the full…

    Write the code Easy 2 stages lists indexing negative index len
  8. Challenge

    Missing index

    …indexes exist, fix it, then pick out readings at either end and in the middle. Predict and run Don't run the code yet. Read it and decide what it will print. Write your guess in prediction , at the…

    Fix the code Easy 3 stages lists indexing IndexError len
  9. Challenge

    Alert level

    …each branch instead of printing it, and print once at the end: ENG-2: 412.5 °C, WARN Each branch sets level , and the single print() after the chain uses it.

    Write the code Easy 2 stages if elif else comparisons