Results for “units”

Showing 1–10 of 25

  1. Challenge

    Units and separators

    …of decimal places, thousands separators and the right units. The stored values stay exact; only the way they're printed changes. Speed Print the speed rounded to two decimal places, with its unit…

    Write the code Easy 3 stages f-strings number formatting rounding telemetry
  2. 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
  3. Challenge

    Unit mix-up

    …Find the variable that holds a distance in a different unit and store its name, as text, in odd_one_out . Then convert it: one mile is 1.609344 km. Store leg 2 in km, as a number, in leg_2_in_km…

    Fix the code Easy 3 stages units conversion constants debugging
  4. Challenge

    Names with values

    …two lists together with zip(), then add a third list of units and warn when the lists don't have the same length, since zip() quietly stops at the shortest.

    Write the code Easy 2 stages for loop zip lists unpacking
  5. Challenge

    Line to record

    …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

    Sensor ID parts

    Split a sensor ID like ENG-2 into its subsystem and its unit number as an int, work out the next ID, then handle subsystems with a dash in their name using rsplit().

    Write the code Medium 2 stages strings split rsplit int
  7. Challenge

    Settings with defaults

    …since every user shares it. Then print every setting: units: imperial language: en telemetry_rate_hz: 10 dark_mode: True alerts: all DEFAULTS.copy() makes a separate dict, and…

    Write the code Medium 2 stages dictionaries copy update defaults
  8. Challenge

    Parser function

    …4 {'time': '09:30:05', 'sensor': 'ENG-2', 'value': 412.5, 'unit': 'C'} {'time': '09:30:05', 'sensor': 'TANK-1', 'value': 78.3, 'unit': '%'} {'time': '09:30:10', 'sensor': 'CABIN', 'value': 101.2…

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

    Parse a telemetry line

    …Time: 2026-03-14T09:30:05Z Sensor: ENG-2 Value: 412.5 Unit: C line.split(",") cuts the text at every comma and gives a list of the pieces. You pick a piece by its index, the same way as a character in…

    Write the code Easy 2 stages strings split parsing csv
  10. Challenge

    CSV row

    …Print the header above the reading: date,sensor,value,unit 2026-03-14,ENG-2,412.5,C Use a second print() with the four column names as separate texts, and the same sep . Tabs for a spreadsheet The…

    Write the code Easy 3 stages print sep csv telemetry