Adding to a list "moves everything down by 1"?


#1

Python syllabus Part 5 ‘Lists and Dictionaries’ 7/14 states the following:

We insert “dog” at index 1, which moves everything down by 1.

Is this right?
What I see is the index of all items above the inserted item now have a HIGHER index not lower.

Should I report this as an error?


#2

There are typically two directions that we can increase a table, in width, or in height. When we consider our table is a list (which are usually represented vertically), a new element inserted anywhere but the bottom of the list will appear to push everything down one index to make room for the new item. This is what the author is referring to. The lowest index is at the top, the highest at the bottom.

In this introductory course don’t get too hung up on semantics. A single dimension list can also be treated as a row. The row grows from left to right so that the leftmost index is the lowest, 0, and the rightmost index is the highest.

Nothing to report so long as you are beginning to understand what the author meant. If you have a suggestion for better wording, then submit it as such, in the other section of the form. However, in the time it takes you to do that, you could be done this unit. How valuable is your time, and will your suggestion be worth it?


#3

Thanks for your response I guess it’s like discussions on memory…whether the stack visually grows up or down is based on the orientation of the address space: low addresses at top or low addresses at bottom.

Not how valuable is my time, but more like what impact would it make among the thousands of others using this as a tutorial on which to build their fundamental knowledge.
This website was built on the sacrifice of time, and users should contribute to it’s success likewise.
As you have done so for me.

All the best


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.