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…
Showing 11–15 of 15
Challenge
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…
Challenge
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…
Challenge
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…
Article Mini projects
…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…
Article Python Fundamentals
…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 #…