Results for “except”

Showing 11–15 of 15

  1. Challenge

    Command parser

    Write parse_command(), which turns typed commands 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…

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

    Clear error messages

    fuel_needed() quietly 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…

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

    Unit converter

    Write convert(), which looks a unit pair up in a table of factors, works the other way round by dividing, and refuses unknown units or missing pairs with a clear ValueError, then extend the table with…

    Write the code Medium 2 stages project dictionaries tuples as keys functions
  4. Article Mini projects

    Base 6 Number System in Python

    …See the pattern? It works exactly like decimal counting, except you "roll over" to the next position after every 6 values instead of every 10. How Position Values Work in Base 6 In base 10, each…

  5. Article Python Fundamentals

    Variables and data types in Python

    …while and elif global not with as else if or yield break except import pass Example of valid variable names in space context: orbital_velocity = 7.8 # kilometers per second ISS_altitude = 408 #…