Results for “strip”

Showing 31–40 of 44

  1. Challenge

    Mission Control online

    Print status lines that a monitoring system reads character by character. A first Python challenge on exact output with print(), right in your browser.

    Write the code Easy 2 stages print output strings beginner
  2. Challenge

    Test the parser

    Write assert checks for parse_line() from "Parser function": the whole record for a good line first, then None for a blank line, a comment and a line with a missing field, so a broken parser can't…

    Write the code Medium 2 stages testing assert parsing None
  3. Challenge

    Real JSON

    …is text, and the program stops with TypeError: string indices must be integers . Turn the text into a dict with json.loads() , then add a line for crewed : Launch: Lumen-3 Provider: JAXA Status: Go…

    Write the code Easy 2 stages json json.loads modules import
  4. Challenge

    Approved payloads

    …cleared for loading PL-999: not on the approved list Strip the spaces and make it upper case, then use if with in . For " pl-117 " it prints the first line.

    Write the code Easy 2 stages lists in membership if
  5. Challenge

    Missing reading

    …Check the field before converting it: ENG-2: NO DATA Strip the field first, so a field with only a space counts as empty too, then compare it with "" . Convert with float() only in the else .

    Write the code Medium 2 stages if else None is None
  6. Challenge

    Upload router

    …-> images/ Keep two versions of the name: one stripped for showing, one stripped and lower-case for checking.

    Write the code Easy 2 stages if elif else or
  7. Challenge

    Telemetry from CSV

    …csv.DictReader Replace the old parser and its feed string: open telemetry.csv with newline="" , loop over csv.DictReader(csv_file) , and print each row in the same format as before: 09:30:05 ENG-2…

    Write the code Medium 2 stages csv csv.DictReader files open
  8. 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
  9. 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