Results for “types”

Showing 31–40 of 40

  1. 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
  2. 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
  3. 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
  4. 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
  5. 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
  6. 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
  7. Challenge

    Aligned status board

    …Python fills the rest with spaces, so remove the space you typed between the two values. Header Add a header row, so people know what the columns are: SYSTEM STATE Propulsion GO Navigation GO Comms…

    Write the code Medium 3 stages f-strings alignment tables formatting
  8. Challenge

    Log line format

    …code that builds these lines from values, so nobody has to type them by hand. Fill in the pattern The starter code gives you three values. Print them as one log line, in exactly this shape…

    Write the code Easy 2 stages f-strings print logs formatting
  9. Challenge

    Environment check

    …One flight software, filled in by Python rather than typed by hand. Ask Python The starter code imports the platform module. platform.python_version() asks Python which version is running your code…

    Write the code Easy 3 stages platform sys python version bug report