Results for “index”

Showing 11–20 of 24

  1. 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…

    Write the code Medium 2 stages strings in find slicing
  2. Challenge

    Nested response

    …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.

    Write the code Easy 2 stages dictionaries nested data lists JSON
  3. Challenge

    Roster changes

    …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…

    Write the code Easy 2 stages lists append insert remove
  4. Challenge

    Redact the access code

    …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.

    Write the code Medium 2 stages strings slicing len replace
  5. Challenge

    Parse a telemetry line

    …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()…

    Write the code Easy 2 stages strings split parsing csv
  6. Challenge

    Debris grid

    …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…

    Write the code Medium 2 stages nested loops enumerate range strings
  7. Challenge

    Telemetry pipeline

    …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…

    Write the code Hard 3 stages project csv json files
  8. Challenge

    Launch counter crash

    …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…

    Fix the code Medium 3 stages functions scope UnboundLocalError global
  9. Challenge

    API response

    …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…

    Write the code Easy 2 stages dictionaries keys items JSON