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
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