There has a list A['a','b','c']
another struct B,
How to use A get below fommat?
B[A[0]][A[1]][A[2]]
There has a list A['a','b','c']
another struct B,
How to use A get below fommat?
B[A[0]][A[1]][A[2]]
You can also do:
>>> A = ['a', 'b', 'c']
>>> B = list(map(lambda x: [x], A))
>>> B
[['a'], ['b'], ['c']]
>>>
Per comment OP was looking for:
A = ['a', 'b', 'c']
B = list(map(list, A))
print(B)
Result
[['a'], ['b'], ['c']]
This could also be achieved with list comprehension, though this is more verbose.
[[x] for x in A]