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…
Showing 1–10 of 25
Challenge
…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…
Challenge
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…
Challenge
…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…
Challenge
…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.
Challenge
…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.
Challenge
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().
Challenge
…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…
Challenge
…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…
Challenge
…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…
Challenge
…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…