Nested for-loop

Hi
the following cod is not working in dynamo python why?

list = [[1,2,3,4],[2,3,4,5]]
t=
for i in list:
it=
t.append(it)
for j in i:
if j==2:
it.append(j)

The boxes are [ ] dont know why it idid that and it took away all my indent let try again

list = [[1,2,3,4],[2,3,4,5]]
t=
for i in list:
it=
t.append(it)
for j in i:
if j==2:
it.append(j)

Hi @johanna.ronnerBMXSJ !
You can use the </> button in the post editor to keep the indent (select all the code text and then use the button).
Could you explain or write the result you are looking for with your code ?

1 Like

currently your code is working

1 Like