Codele / Programming basics
Lists
A shopping list is one piece of paper with many things on it, in order. A computer has the same idea: one box that holds many things.
- A list is one box that holds many things, in order.
- Each thing has a position (an index). Counting starts at 0, not 1.
- Append adds to the end. Giving a position a new value replaces that thing.
- The length is how many things are in the list. The last position is length minus 1.
- A for each loop visits every thing once, in order.
Loading the playable lesson…