I think List Slicing Syntax instruction is wrong


#1



List Slicing Syntax (Lesson 7):
https://www.codecademy.com/en/courses/python-beginner-en-KAgt5/2/1?curriculum_id=4f89dab3d788890003000096

and

Practice makes perfect (Lesson 11):
https://www.codecademy.com/en/courses/python-beginner-en-KAgt5/2/5?curriculum_id=4f89dab3d788890003000096

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.



#2

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