Dec-04-2018, 04:05 PM
So. Brainfart here atm.
I have a list of which I don't if it consist out of (all) nested lists or just simple values.
So
listA = ["a", "b", "c"]
or
listA = [list1, list2 ]
list1=["a", "342"]
list2=["2fasd", "adf3gfds"]
If have to run a function I defined of those values of the single list hierachy (so listA (only the first example), list1, list2)
I can't check isinstance(listA, list) because both are lists. So I have to check if at all this is true, and if so: are there any nested lists. and if so: do that function there.
for i in list:
//do function
I've done some any(l in list) for l in listA but that does nothing.
Hope it makes sense.
I have a list of which I don't if it consist out of (all) nested lists or just simple values.
So
listA = ["a", "b", "c"]
or
listA = [list1, list2 ]
list1=["a", "342"]
list2=["2fasd", "adf3gfds"]
If have to run a function I defined of those values of the single list hierachy (so listA (only the first example), list1, list2)
I can't check isinstance(listA, list) because both are lists. So I have to check if at all this is true, and if so: are there any nested lists. and if so: do that function there.
for i in list:
//do function
I've done some any(l in list) for l in listA but that does nothing.
Hope it makes sense.