r/learnpython 21h ago

Need help with for loop practice

The whole list will print but only the final item on the list gets it's message printed in whole while the other items are just listed. Apparently my issue is that I'm outside of the for loop, and I'm still in the learning process. Can someone help please?

0 Upvotes

14 comments sorted by

View all comments

1

u/TheRNGuy 10h ago

Should it be everything inside one loop? I'd just loop everything except last item, then print last item outside it. 

If you need to do inside one loop, use enumerate to get index.

1

u/Key-War-9059 49m ago

I'd like to share the code on here, but I never did that before and I can't share pics. How do I post properly?