Decimal comma
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.
Start the challengePractise what this example shows with these challenges.
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.
Start the challengeSplit a telemetry reading like 2026-03-14T09:30:05Z,ENG-2,412.5,C into its four fields with split(), print each with a label, then turn the value into a number and convert it to kelvin.
Start the challengeSplit a sensor ID like ENG-2 into its subsystem and its unit number as an int, work out the next ID, then handle subsystems with a dash in their name using rsplit().
Start the challengeCheck whether a mission log line contains ERROR with in, find where it starts with find(), including the -1 it gives when there is nothing to find, then slice out the error message.
Start the challengeCount the entries and the WARN lines in a multi-line mission log with count(), fix the count when a message mentions WARN itself, then summarise the log by level.
Start the challengeWrite 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 report each one.
Start the challengeStuck on this example or want to go further? Ask here, or see what others asked.
Log in to ask and reply.
Separate arguments with commas. They're passed on every Run as sys.argv[1:].
Log in or create a free account to save your code and share it with a link. Your code will be waiting here when you come back.