2
u/King_Novice Jul 19 '21
notes written in photo I have a list that I need to append some stuff from, but that list is already inside another list. Does anyone know the syntax for this kinda thing?
2
u/bbye98 Jul 19 '21
I don’t understand the question. Appending to a list inside a list is the same as appending to a standalone list.
3
u/Nightcorex_ Jul 19 '21
Okay. What do you want to achieve?
Do you want to filter out all the zeros of the nested lists? If so, then this achieves your goal:
Note that this alters the original double nested list.
If you want to remove the entire sublist if all of its entries are zero, then this solves your issue:
If you want to remove the entire sublist if one of its entries is zero, then this solves your issue:
These last 2 methods abuse the fact that 0 is a falsy value, while the others are true.