How to convert each pair of list into tuple in python

前端 未结 0 969
误落风尘
误落风尘 2020-12-20 11:54

I want to convert list = [1,4,2,3,0] to list_tup = [(1,4),(4,2),(2,3),(3,0)]. You can see my code below but it outputs [(1,4),(2,3)].

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