r/PythonLearning • • Aug 17 '25

What's wrong

Post image
49 Upvotes

45 comments sorted by

View all comments

42

u/Grounds4TheSubstain Aug 17 '25

Your print statement says n, not i.

11

u/therouterguy Aug 17 '25

But also a you can also just do for i in list: print(i)

0

u/[deleted] Aug 17 '25

[deleted]

2

u/willis81808 Aug 19 '25

There's always

for index, value in enumerate(l):
  print(index, value)

Best of both worlds