Results for “types”

Showing 61–70 of 73

  1. Challenge

    Accept the right files

    …before it's accepted, then make the checks work for paths typed on a Windows PC. Check the ends Print whether the path starts with telemetry/ and whether it ends with .csv : In telemetry/: True CSV…

    Write the code Easy 2 stages strings startswith endswith paths
  2. Challenge

    Undo and history

    …and last week a crate was removed by mistake and had to be typed back in from memory. Extend the console with a history of changes, then an undo that uses it. A history of changes The console works as…

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

    Real JSON

    …but response_text is text, and the program stops with TypeError: string indices must be integers . Turn the text into a dict with json.loads() , then add a line for crewed : Launch: Lumen-3 Provider…

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

    Test the error

    …a version that doesn't raise at all, and one that raises TypeError instead; your check must fail on both. The message, and what must still work A function that refuses everything would pass your test…

    Write the code Medium 2 stages testing assert try except
  5. Challenge

    Confirm by name

    …With the * in place, abort("Test", True) stops with a TypeError , and so does abort("Test") . Only True itself Someone passed confirm="yes" , and since a non-empty string is true, the abort ran…

    Write the code Medium 2 stages functions keyword-only arguments * safety
  6. Challenge

    Test the parser

    …returns with the dict you expect, so every field and its type are checked. When they all hold, print: All checks passed For example, a line from the feed, "2026-03-14T09:30:05Z,ENG-2,412.5,C" , should…

    Write the code Medium 2 stages testing assert parsing None
  7. Challenge

    Validate a cargo record

    Cargo records arrive from several warehouses, typed by different people. Before an item goes on the manifest, it has to pass a check, and when it fails, the warehouse needs to know everything that is…

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

    File name from data

    …and remove any spaces around it first, since people type those into forms. The date is the first 10 characters of the timestamp. A folder for each sensor Each sensor's files go into a folder of their…

    Write the code Easy 3 stages strings f-strings lower replace
  9. Challenge

    Parse a telemetry line

    …split() gives text, so "412.5" + 273.15 would stop with a TypeError . Turn the value into a number, show it with its unit, and add the temperature in kelvin, with two decimal places: Time…

    Write the code Easy 2 stages strings split parsing csv