How would you zip an unknown number of lists in Python?

前端 未结 1 697
無奈伤痛
無奈伤痛 2020-12-10 23:57

Let\'s say I have the following lists:

assignment = [\'Title\', \'Project1\', \'Project2\', \'Project3\']
grades = [ [\'Jim\', 45, 50, 55], \\
           [\'         


        
相关标签:
1条回答
  • 2020-12-11 00:34

    You can use * to unpack a list into positional parameters:

    zip(assignment, *grades)
    
    0 讨论(0)
提交回复
热议问题