Results for “python tuple”

Showing 21–28 of 28

  1. Challenge

    Alert deduplicator

    The monitoring system raises the same alert over and over. Group repeats of an alert that come within 60 seconds of the first into one line with a count, in the order they first appeared, then add the…

    Write the code Hard 2 stages project dictionaries tuples as keys grouping
  2. Challenge

    Undo and history

    Extend the working cargo console: record every change to the hold in a history list and show it with a history command, then add undo, which takes the last change off the history and reverses it.

    Write the code Hard 2 stages project lists stack append
  3. Challenge

    Unit converter

    Write convert(), which looks a unit pair up in a table of factors, works the other way round by dividing, and refuses unknown units or missing pairs with a clear ValueError, then extend the table with…

    Write the code Medium 2 stages project dictionaries tuples as keys functions
  4. Challenge

    Extract a function

    Move a 3D distance calculation that is copied for three waypoints into distance_km(a, b), keeping the output exactly the same, then put the waypoints in a dict and find the nearest one with the same…

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

    Any number of values

    …The whole pass: 419.5 Inside the function, values is a tuple, so sum() and len() work on it. In the second call, average(*readings) passes the five readings as five separate arguments. An option after…

    Write the code Easy 2 stages functions *args unpacking keyword-only arguments
  6. Challenge

    Print the manifest

    In "Manifest line" you printed one item from a tuple. The logistics system now exports the whole manifest as a list of dicts, one per item, with an ID, a name, a category and a mass. The loading crew…

    Write the code Easy 2 stages dictionaries lists of dicts for loop formatting
  7. Example

    Creating Sets

    Sets store only unique elements without a specific order.

    Audio lesson set unique