I want to loop through a list and terminate when I reach a certain value. Something like:
ls = ['yes','yes','stop','yes']
while a in ls <> 'stop':
print a
Would print:
yes
yes
I know I can do:
for a in ls:
if a == 'stop':
break
print a
but it seems messy.
<>. That operator was deprecated in Python 2.5 and removed entirely from Python 3.x. You should be using!=instead.