Home > other >  How to after the for loop in Python list into a list?
How to after the for loop in Python list into a list?

Time:11-11

For example: after the for loop (circulation) after get the result list (several) of the following:
[jack, 31100, 00]
[Tim, 56100 0]
[John, 33300, 0]

How will the name of the parts into a list? Age in a list?

CodePudding user response:

 data=https://bbs.csdn.net/topics/[[' jack ', 31100, 00], [' Tim, 56100], [' John ', 33300 0]] 

Names=[d [0] in the data for d]
Which=[d [1] in the data for d]
Print (names)
Print (which)

CodePudding user response:

A=[' jack ', 31100, 00]
B=[' Tim, 56100 0]
C=[' John ', 33300 0]

Print (list (zip (a, b, c)))
  • Related