Since the list cont
would have the values:
cont = ['t','f','f','t','f']
You could do something like this:
while(for cont in cont == 'f'):
pass
Since the list cont
would have the values:
cont = ['t','f','f','t','f']
You could do something like this:
while(for cont in cont == 'f'):
pass
You can put a condition when iterating:
letras = ['t','f','f','t','f']
for letra in [i for i in letras if i != 'f']:
print(letra)
Or put the condition out of loop :
letras = ['t','f','f','t','f']
for letra in letras:
if letra == 'f':
continue
print(letra)
Yes, but try without while
:
for letraF in [letra for letra in cont if letra == 'f']:
print(letraF)