2021年5月4日星期二

How to access an element of a nested list with loop

how to access an element of nested list with a loop? like:

a = [20,[22,[3,[21]]]]                 #^^ i want to access this    

how to access it with a loop, insead of using

a[1][1][1][1]    

any solution on any language is accepted (preferably python)

https://stackoverflow.com/questions/67394269/how-to-access-an-element-of-a-nested-list-with-loop May 05, 2021 at 10:04AM

没有评论:

发表评论