Challenge
What arrived?
…and text that only looks like numbers. Predict what type() shows, find the values that need converting, then convert a packet yourself.
Showing 1–10 of 40
Challenge
…and text that only looks like numbers. Predict what type() shows, find the values that need converting, then convert a packet yourself.
Challenge
…decimals and True/False. A PRIMM challenge on Python data types.
Challenge
…says what it returns and what the reserve means, then add type hints for its parameters and return value; the tests read both from the function itself.
Challenge
…out the crew after the next docking. Whatever number you type, it crashes. Predict what happens, find out why input() is behind it, fix it, then write a packing tool that reads two numbers. Predict…
Challenge
An operator types 42,5 and float() crashes with a ValueError. Predict it, find out why, accept both commas and dots with replace(), then read pressures written like 1 013,25.
Challenge
…with a message that shows the bad value, then raise TypeError, checked first, when the length isn't a number at all.
Challenge
The burn length is typed in by hand, and a typo stops the program with a ValueError. Catch it with try and except, keep asking until the input is a number, then also turn away zero and negative…
Challenge
A status line crashes with a TypeError because it joins text and a number with +. Predict it, read the error, fix it with str(), then build a docking status line.
Challenge
…and dashes too, so commands match however operators type them.
Challenge
A 40-line pre-burn check has five bugs: a syntax error, a type error, a wrong key, an index out of range and a reversed decision. Read each error to fix the four that crash, then find the one that…