liveBook · Manning

Reference

As explained in Get Programming: Learn to code with Python

A reference is an indirect value or relationship that identifies or provides access to another value, object, resource, or source.

Here, start and end pointers are index positions in a string. They mark the beginning and current end of a word while the string is scanned character by character. section 19.2

To split newline-separated words:

  • Set start and end to the first character. section 19.2
  • Move end forward until it reaches a newline, then save the characters between start and end as a word. section 19.1
  • Move both positions to the character after the newline to begin the next word. section 19.2
Figure 19.1. Converting a string of characters into words. In the top example named start, you can keep track of where you are in the character string by using a start and end pointer. In the middle example named found word, you stop changing end when you reach a newline character. In the bottom example named start next, you reset the start and end pointers to the character right after the newline.

The three stages show how the positions mark a word, stop at its newline, and move to the next word. section 19.1

How Get Programming: Learn to code with Python covers it

How deep it goes
Works through initialization, newline detection, word slicing, and pointer resets in a string-scanning loop.
Examples
Uses a multiline list of art words and traces pointer movement across newline characters.
What you can do after
Build a loop that separates newline-delimited words using start and end indices.
How it connects
Connects index positions with string slicing, newline characters, loops, and tuples.

Also explained in

Compare how 17 books explain reference →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Get Programming: Learn to code with Python. The section links point to the parts of the book it draws on.