Results for “type()”

Showing 31–40 of 40

  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

    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
  7. 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
  8. 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
  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