Challenge
Normalise a command
Turn " Launch " into launch with strip() and lower(), check it against the command list, then accept underscores and dashes too, so commands match however operators type them.
Showing 1–10 of 17
Challenge
Turn " Launch " into launch with strip() and lower(), check it against the command list, then accept underscores and dashes too, so commands match however operators type them.
Challenge
…for the analogue mission: trim and capitalise names, lower-case emails, then reject sign-ups with no name or a broken email and drop duplicates by email, saying why for each one.
Challenge
…names like de Vries and van Dijk correctly with key=str.lower.
Challenge
…them, and safe, so they work on every operating system: lower case, no spaces, the sensor first and then the date. Build the file names from the data, then a folder path for each sensor. From an ID…
Challenge
…: Starting the sequence Normalise the answer with strip().lower() straight away, then compare it in an if / elif chain, with else at the end. Helpful errors Make the errors helpful. For an empty…
Challenge
…command: dance REJECTED "": empty command text.strip().lower().split() gives the words. Converting the length can raise its own ValueError : catch it and raise yours, with a clearer message. set mode…
Challenge
…From 400 °C it's WARN, from 450 °C CRITICAL, anything lower is OK. For 412.5: WARN Check the most serious level first: if for CRITICAL, elif for WARN, else for OK. "From 400" includes 400 itself, so…
Challenge
…what crate[1:] gives, as text, in rest . Then put crate.lower() on a line of its own, print crate , and store whether it is still "P0042" , True or False , in unchanged . Remove the lines you added…
Challenge
…it by sorting in place, then sort readings from highest to lowest and keep the top three.
Challenge
…team gets a summary of the temperature readings: the lowest, the highest and the average. Nobody reads five hundred numbers; everybody reads the summary. Summarise the readings with Python's built-in…