How to assign each element of a list to a separate variable?

前端 未结 7 1741
花落未央
花落未央 2020-12-01 14:12

if I have a list, say:

ll = [\'xx\',\'yy\',\'zz\']

and I want to assign each element of this list to a separate variable:

v         


        
7条回答
  •  一个人的身影
    2020-12-01 14:40

    You should go back and rethink why you "need" dynamic variables. Chances are, you can create the same functionality with looping through the list, or slicing it into chunks.

提交回复
热议问题