Challenge
Mission config
…decimals and True/False. A PRIMM challenge on Python data types.
Showing 11–20 of 73
Challenge
…decimals and True/False. A PRIMM challenge on Python data types.
Example
Python allows changing variable type during program execution. This is dynamic typing.
Challenge
…with a message that shows the bad value, then raise TypeError, checked first, when the length isn't a number at all.
Challenge
…are written. Investigate and modify Investigate. Store the type of the readings in reading_type : int , float , str or bool . Modify. The readings arrive as text, so leave the two lines that set 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…
Quiz
…quiz: 15 Python errors to read and fix – NameError, TypeError, ValueError, IndexError, KeyError, IndentationError and ZeroDivisionError.
Challenge
…and dashes too, so commands match however operators type them.
Challenge
…line just above it is where it happened. Fill in error_type , crash_function and crash_line at the end of the program, then fix the bug on that line so the program prints: Average: 695.0 K Fix the…
Challenge
…can last part of a second, like 12.4. When you press Run, type the number in the console. When you check, the tests type it for you. What the burn leaves The flight director also wants to know what…
Challenge
code[0] = "X" stops with a TypeError, because Python strings can't be changed. Predict the crash, find out what methods and slices really give, build a new string instead, then swap a letter in the…