Good day! There was a hitch with cycles in python. The essence of the problem is that when a certain value is found in the list "c", the list "a" goes to the next iteration, and the lists "b" and "c" are reset. I can not understand how to do this with a loop with a double attachment.
a = [1, 2, 3, 4, 5] b = [10, 20, 30, 40, 50] c = [100, 200, 300, 400, 500] for i in a: for j in b: for q in c: if q == 400: pass print(i, j, q) If a loop with one attachment - everything is very simple. The break instruction helps, the "b" cycle ends and a transition to the next iteration of the "a" cycle occurs:
a = [1, 2, 3, 4, 5] b = [10, 20, 30, 40, 50] for i in a: for j in b: if j == 40: break print(i, j) and how to be in the first case?
break middle(break with label) to use, for example, in Go - jfs