options[-1]:
Is there any other(Pythonic way) to check if the item(option) from a list(options) is the last element of the list?
Do you need every occurance, or just want to see if it occurs anywhere other than the last position?
your code does more than check for "last" – anyway, use enumerate()
Обсуждают сегодня