List Slicing Error?


#1



https://www.codecademy.com/courses/python-beginner-en-pwmb1/1/2?curriculum_id=4f89dab3d788890003000096#


I'm not sure what has happend but instead of needing index [0:1] it needs [0:2] even though it says in the instructions that it needs [0:1]. It happends with all three of them. [2:3] needs [2:4] [4:5] needs [4:6].



#2

[ included_starting_index : excluded_ending_index ]
string = "string"
string[0:0]    # ""
string[0:1]    # "s"

#3

Ah yes thanks i found that out in the next lesson and i felt like a fool :no_mouth:


#4

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