I think List Slicing Syntax instruction is wrong


List Slicing Syntax (Lesson 7):


Practice makes perfect (Lesson 11):

Lesson 7 states for [start:end:stride] "Where start describes where the slice starts (inclusive), end is where it ends (exclusive)..."

I would expect then in lesson 11 Practice Makes Perfect that middle_third = to_21[8:15] would pull 8-14 as 8 would be inclusive and 15 exclusive. However, when doing so it does not work as such and actually starts at 9 (excluding 8, the start) and pulls 15 (including the end).

Testing this in pycharm it seems the instructions are backwards as it works the way opposite of the instructions state but the way the console in 11 expects it.


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