More pythonic way of item_list[-1] != item_list[-2]?

前端 未结 0 1021
-上瘾入骨i
-上瘾入骨i 2021-01-25 09:14

I\'m updating and then referring to the last item added to a list to determine an outcome, for example:

if item_list[-1] != item_list[-2]:
   outcome1


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题