Challenge
Search the log
…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 . line.find("ERROR") gives the index of the…
Showing 11–20 of 24
Challenge
…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 . line.find("ERROR") gives the index of the…
Challenge
…URL from a nested launch response by chaining keys and indexes, then add the operator and orbit and cope with a launch that has no patches yet.
Challenge
The flight log script won't run. Read the error message, go straight to the line it names and fix it. Learn to debug Python syntax errors the way programmers do.
Challenge
…adds at the end, crew.insert(1, x) puts x at index 1, and crew.remove(x) deletes it. Use the variables, not the names. Reassigned After the changes, the newest member, now last in the list, is…
Challenge
…line.find(" ", start) searches for a space starting at index start , so it finds the space after the code, not the first one in the line. Then line.replace(code, masked) builds the new line.
Challenge
…and gives a list of the pieces. You pick a piece by its index, the same way as a character in a string: fields[0] is the first. Lists get a stage of their own later. The value as a number split()…
Challenge
…row, and print its row and column, both counted from 0, as indexes are. Then print how many there are: Debris at row 0, column 2 Debris at row 2, column 5 Debris at row 3, column 0 Hits: 3 Loop over…
Challenge
…rejected and the alerts list, written with json.dump() , indent=2 and ensure_ascii=False . Then print one last line: Saved summary.json The hidden tests open summary.json and compare it with what they…
Challenge
…find out why, then fix it in a way that keeps the function independent of the rest of the program. Predict and run Don't run the code yet. Read it and decide what it will print. Write your guess in…
Challenge
…whole response. After the three lines, print every field, indented by two spaces, in the order the response has them: Launch: Lumen-3 Provider: JAXA Status: Go All fields: id…