Results for “raise”

Showing 1–10 of 24

  1. Challenge

    Clear error messages

    …returns negative fuel for a negative burn length. Make it raise ValueError with a message that shows the bad value, then raise TypeError, checked first, when the length isn't a number at all.

    Write the code Medium 2 stages errors raise ValueError TypeError
  2. Challenge

    Command parser

    …such as burn 12.5 or set mode safe into tuples and raises ValueError with a reason for anything malformed, then run a whole batch of commands and report each one.

    Write the code Medium 2 stages project parsing strings split
  3. Challenge

    Test the error

    Write a check that passes only when fuel_needed(-5) raises ValueError, so a version that returns a value or raises the wrong error fails it, then pin down the message and the lengths that must still…

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

    Unit converter

    …round, divide; for the same unit twice, return the value. Raise ValueError for a unit the table doesn't know, unknown unit: ... , or for two known units with no factor between them. Then run the…

    Write the code Medium 2 stages project dictionaries tuples as keys functions
  5. Challenge

    Alert deduplicator

    The monitoring system raises the same alert over and over. Group repeats of an alert that come within 60 seconds of the first into one line with a count, in the order they first appeared, then add the…

    Write the code Hard 2 stages project dictionaries tuples as keys grouping
  6. Challenge

    Test the pipeline

    …the value as a number, and a row from an unknown sensor raises ValueError . Then print: All checks passed Leave the functions as they are. The hidden tests plant two bugs in parse_row() : one keeps…

    Write the code Hard 2 stages project testing assert try
  7. Article Mini projects

    Medical dispenser - Don’t trust the user

    …if expected_hmac != stored_hmac: raise ValueError(f"HMAC verification failed at event {i}") return events except Exception as e: print(f"Error loading log: {e}") return [] def _save_log(self)…

  8. Challenge

    Flight software review

    The pre-burn check decides whether the orbit-raising burn goes ahead. Someone changed it last night in a hurry, and now it doesn't even start. The burn window opens in an hour, and you are the…

    Fix the code Hard 2 stages project debugging SyntaxError TypeError