Results for “strings”

Showing 31–38 of 38

  1. Challenge

    Last five readings

    …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, append it to the readings, then show the new window…

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

    Survive bad lines

    …2026-03-14T09:30:10Z,CABIN,ERR,kPa (could not convert string to float: 'ERR') 09:30:10 ENG-2: 415.0 C Skipped: 2026-03-14T09:30:15Z,ENG-2,4l7.9,C (could not convert string to float: '4l7.9') 09:30:15…

    Write the code Medium 2 stages errors try except ValueError
  3. Challenge

    Confirm by name

    …Someone passed confirm="yes" , and since a non-empty string is true, the abort ran. Accept only True itself, and add the call that tried: ABORT: Cabin pressure falling Abort refused: pass confirm=True…

    Write the code Medium 2 stages functions keyword-only arguments * safety
  4. Challenge

    API response

    …its key in square brackets: launch["name"] . Inside an f-string, use single quotes for the key: {launch['name']} . Everything in the response Before relying on an API, developers look at a whole…

    Write the code Easy 2 stages dictionaries keys items JSON
  5. Challenge

    Parse the whole feed

    …kPa ENG-2: 415.0 C feed.splitlines() gives a list with one string per line. Inside the loop, line.split(",") gives the four fields, as in "Parse a telemetry line". Named fields and the time Unpack the…

    Write the code Easy 2 stages for loop splitlines split unpacking
  6. Challenge

    Duration formatter

    …digits, so 3725 seconds would show as 01:02:05 . In an f-string, {minutes:02d} pads a whole number with zeros to two digits. Days too Long missions count days as well. Mission control displays often…

    Write the code Easy 3 stages floor division modulo // %