I want to perform some actions within a huge list, which contains multiple lists, and within those multiple lists, they also have some lists, for example:
arr = [[[1, 2], 3], [2, 3, 4]]
How can I perform some actions with all the elements within these lists, for example +1 ? And the result will be :
[[[2, 3], 4], [3, 4, 5]]
I know I can use for
to loop through every list, but sometimes those elements might be string
or other types?
And I know I can check type()
for every element inside the list do it recursively and perform some actions, but is there any simple way to solve this problem?
Too broad my ass