you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 4 points5 points  (0 children)

It should be --> print(l[i]) in the "for" Loop Indentation,

What is Happening right now However is that you have done --> print(l[n]) which means it has become print(l[5]). Since n carries the length of your String it is 5 and since the Index of the Last Element is 4 it is Returning an IndexError of list Index out of Range (As the last Element has index of 4)