I just started coding, so I have a question
for j in range(len(list2)):
for w in range(len(list2[0])):
if list3[w] != list2[j][w]:
new_list.append(list2[j][w])
J = 0, 1 w = 0, 1, 2, 3, 4, 5 We know that w = 0, 1, 2, 3, 4, 5 are repeated at j = 0 and then j = 1 to repeat w again.
If len(new_list) > 1
before moving from j=0 to j=1, run new_list.clear()
len(new_list) == 1
I want to stop the for door, but I have no idea how to code it!
for j in range(len(list2)):
for w in range(len(list2[0])):
if list3[w] != list2[j][w]:
new_list.append(list2[j][w])
if len(new_list) > 1:
new_list.clear()
elif len(new_list) == 1:
break
© 2024 OneMinuteCode. All rights reserved.