Challenge
JSON out
At the end of each day, the mission dashboard sends a summary to the archive, and the archive only takes JSON. The summary already exists as a Python dict. Printing it with print(summary) looks close…
Showing 11–20 of 56
Challenge
At the end of each day, the mission dashboard sends a summary to the archive, and the archive only takes JSON. The summary already exists as a Python dict. Printing it with print(summary) looks close…
Challenge
…Apply the changes in this order: add the new member at the end, insert the backup at position 1, remove the one who is leaving. Then print the roster and its size: Roster: Okafor, Haddad, Lindqvist…
Challenge
…take any extra keyword arguments and add each one to the end of the line as a space and key=value , in the order they were passed: [T+00:12:05] INFO Engines nominal [T+00:14:47] ERROR Fuel valve 2 not…
Challenge
…with the morning's sample already in it, and by the end of the week every new log held every sample ever taken. Predict what the program prints, find out where the old samples come from, fix the…
Challenge
…crew , remove Tanaka from the copy and add Moreau at the end. Then print both: Current: Okafor, Lindqvist, Tanaka, Kowalska Planned: Okafor, Lindqvist, Kowalska, Moreau The current roster must not…
Challenge
add_reading() appends to the list it receives, so the caller's stored readings change too. Predict the first line, prove both names share one list, fix it by returning a new list, then write a filter…
Challenge
A 70-line engine report repeats the same twelve lines for each engine. Restructure it into parse_feed() and summary_line() with the output unchanged to the character, then add assert tests that would…
Challenge
Replace all but the last four characters of an access code with * using len(), slicing and string repetition, then find a code inside a log line and mask it there before the line is saved.
Challenge
…it goes wrong: Python takes the first inner quote as the end of the text. Quotes inside quotes Run the script: Python stops with a SyntaxError , because the double quote before status ends the text…
Challenge
…reason for a refusal now sits four levels deep, at the far end of an else whose if is off the top of the screen. Flatten the function without changing a single answer, then add the next rule the…