Results for “index”

Showing 21–30 of 41

  1. 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
  2. Example

    Creating Sets

    Sets store only unique elements without a specific order.

    Audio lesson set unique
  3. Article Python Fundamentals

    Python Functions for Beginners

    …most common syntax error in this whole topic. Everything indented under the def line is the body of the function. Python uses that indentation (four spaces is the convention) to work out where the…

  4. 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
  5. 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
  6. 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
  7. Article Python Fundamentals

    Python If/Else for Beginners

    …orbit insertion burn.") If fuel_percent > 50 is True , the indented block runs. If it's False , Python skips the block entirely. else — the fallback plan Use else to run code when the if condition is…

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