Results for “type()”

Showing 21–30 of 40

  1. Challenge

    Live T-minus

    …time and datetime.now(timezone.utc) instead of a number typed by hand, then turn it into a countdown() that counts up with T+ after launch.

    Write the code Medium 2 stages datetime datetime.now timezone countdown
  2. Challenge

    Catch what you expect

    …Change except: to except Exception as error: and print type(error).__name__ in it, to see what is really being caught. Store its name in hidden_error , and the number of readings that are really bad…

    Fix the code Medium 3 stages errors try except ValueError
  3. Challenge

    Manifest validator

    The logistics team typed the manifest for the next supply flight by hand, and the loading crew won't touch a crate until every line checks out. Last time, a typo in a mass sent a 61 kg battery pack to…

    Write the code Medium 2 stages project validation dictionaries functions
  4. Challenge

    Sign-up cleanup

    Clean the crew sign-ups for the analogue mission: trim and capitalise names, lower-case emails, then reject sign-ups with no name or a broken email and drop duplicates by email, saying why for each…

    Write the code Medium 2 stages project strings strip split
  5. Challenge

    Telemetry from CSV

    Point the feed parser from "Parse the whole feed" at telemetry.csv: read it with csv.DictReader, using the header row for the field names, then find the hottest temperature reading, comparing the…

    Write the code Medium 2 stages csv csv.DictReader files open
  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

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

    Missing reading

    …of a number, and the check from "Alert level" stops with a TypeError in the middle of a pass. Extend your check so a missing reading is reported, not crashed on, then handle missing values in the…

    Write the code Medium 2 stages if else None is None