在python中,将长度较小的列表(3或4)转换为变量的最佳方法是什么?实际上,我想做的与在Python3中创建这样的列表相反。some_python_list=[a,b,c,d]a,b,c,d=some_python_list.decompose(4) #while I know alist is of length4a=some_python_list[0]c=
我有一个打碎字符串的列表...说其中b是条件1,c是条件2[a, a, a, [b, a,a, [b, a, c], a, [b, a, a, c], a, c], a]
所以我想要处理字符串,这样当我遍历它时,如果项匹配条件1,则打开一个新列表,如果项匹配条件2,则关闭列表并返回上一级。我以前在stackoverflow上见过将列表分解</