r/PythonLearning • • Aug 17 '25

What's wrong

Post image
49 Upvotes

45 comments sorted by

View all comments

1

u/Lobotomized_toddler Aug 18 '25

There’s a few things however what your problem rn is this: len() starts at 1 then counts up. A list starts at 0 then counts up. So while there are 5 numbers it’s ordered as 0,1,2,3,4. While your Len is just counting 5.

print(L[n]} doesn’t make sense because N is trying to point to the fith(technically sixth) spot and that doesn’t exist

Scrap the length idea and just do for I in L