Detect If Item is the Last in a List

QuestionsDetect If Item is the Last in a List
sethbeckerman5 Staff asked 10 years ago

I am using Python 3, and trying to detect if an item is the last in a list, but sometimes there will repeats. This is my code:

And I would like this output:

But I get this output:

I understand why I am getting the output I do not want.
I would prefer if I could still use the loop, but I can work around them. (I would like to use this with more complicated code)


View on Stack Overflow