Results for “strings”

Showing 51–60 of 65

  1. 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
  2. Article Python Fundamentals

    Python Functions for Beginners

    …You can also describe a function with a docstring , a string in triple quotes placed right under the def line: def weight_on_planet(earth_weight, gravity=0.38): """Return what something would weigh on…

  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