Results for “end”

Showing 31–40 of 75

  1. Challenge

    Legacy script

    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…

    Fix the code Hard 2 stages project refactoring functions testing
  2. Challenge

    Redact the access code

    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.

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

    JSON-looking payload

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

    Fix the code Medium 2 stages quotes escape sequences f-strings json
  4. Challenge

    Guard clauses

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

    Fix the code Medium 2 stages functions return guard clauses refactoring
  5. Challenge

    Last five readings

    …The list is oldest first, so the most recent are at the end. A negative start counts from the end, as with strings. The window moves A new reading has arrived. Add new_reading = 772 under the list…

    Write the code Easy 2 stages lists slicing negative slice append
  6. Challenge

    Date and time from a timestamp

    …T , at index 11, and is 8 characters long. In text[start:end] , the character at end isn't included. The way we write it In Poland and much of Europe, dates are written day first, with dots…

    Write the code Easy 2 stages strings slicing indexing timestamp
  7. Challenge

    Normalise a command

    …show: Command: [launch] strip() removes spaces from both ends and lower() turns capitals into small letters. You can call one straight after the other: typed.strip().lower() . Does it match? Now check…

    Write the code Easy 3 stages strings strip lower replace
  8. Challenge

    Aligned status board

    …Because the names are all different lengths, the states end up scattered across the screen, and a HOLD is easy to miss. Line the states up in a column. Format specs can give each value a fixed width…

    Write the code Medium 3 stages f-strings alignment tables formatting