Currently having trouble with breaking this for loop. I want to break it if the variable is not found in this list so it can move two another for loop. It expects an indented block for the top of the for loop, but if I change the position of the break or of the start of the for loop, it doesn't work. Help!
while cyclenumb <= 10000:
for x in userpassword[k]:
for z in lowercaselist:
if x in z:
newpasswordlist.append(z)
k +=1
break
else:
for x in userpassword[k]:
for z in uppercaselist:
if x in z:
newpasswordlist.append(z)
k +=1
break
else:
breakonly breaks out of the inner loop, not the outer loop. Are you sure you need the inner loops? Maybe it should just beif x in lowercaselist- Barmarlowercaselistanduppercaselist? Are they lists of lists? That's whay it looks like when you're looping over them and then usingx in z. - Barmarx in zinstead of justx = z? Or why don't you just writeif x in lowercaselist:? - Barmar