Challenge
Date and time from a timestamp
…the date and the time of day out of the timestamp and print them: Date: 2026-03-14 Time: 09:30:05 The date is the first 10 characters. The time starts after the T , at index 11, and is 8 characters…
Showing 151–160 of 237
Challenge
…the date and the time of day out of the timestamp and print them: Date: 2026-03-14 Time: 09:30:05 The date is the first 10 characters. The time starts after the T , at index 11, and is 8 characters…
Challenge
…the error message that follows. Is it there, and where? Print whether the line contains ERROR , and the index where it starts: Contains ERROR: True Starts at: 13 "ERROR" in line gives True or False…
Challenge
…every second. Read the burn length with input() and print the fuel it uses, with one decimal place. For 42 : Fuel used: 315.0 kg input() always gives text, so turn it into a number with float()…
Challenge
…out how long a radio signal takes to reach the orbiter and print it with one decimal place: One-way delay: 750.5 s Time is distance divided by speed. The speed of light is already in the code as a…
Challenge
…and a row from an unknown sensor raises ValueError . Then print: All checks passed Leave the functions as they are. The hidden tests plant two bugs in parse_row() : one keeps the value as text, the…
Challenge
…before launch, and at launch itself, and T+ after it, then print countdown(launch, datetime.now(timezone.utc)) . With the clock stopped five minutes after launch, the check expects: T+00:05:00 Pick…
Challenge
…to True in except ValueError: , and assert it after. Then print: All checks passed Leave the function as it is. The hidden tests swap it for a version that doesn't raise at all, and one that raises…
Challenge
…check each call got a list with only its own sample. Then print: All checks passed Leave the function as it is. The hidden tests swap it for the old version with log=[] , and your checks must stop…
Challenge
…isn't a whole number, such as [1, 2] . When they all hold, print: All checks passed Leave the function exactly as it is. The edges Now the edges. Add checks that an empty list gives None (compare with…
Challenge
…OK, one for WARN and one for CRITICAL. When they all hold, print: All checks passed For example, assert alert_level(20) == "OK" . Leave the function exactly as it is: the hidden tests break copies of…