A
ahlongxp
list=('a','d','c','d')
for a in list:
if a=='a' :
#skip the letter affer 'a'
what am I supposed to do?
for a in list:
if a=='a' :
#skip the letter affer 'a'
what am I supposed to do?
2007/6/11 said:list=('a','d','c','d')
for a in list:
if a=='a' :
#skip the letter affer 'a'
what am I supposed to do?
ahlongxp said:list=('a','d','c','d')
for a in list:
if a=='a' :
#skip the letter affer 'a'
what am I supposed to do?
list=('a','d','c','d')
for a in list:
if a=='a' :
#skip the letter affer 'a'
what am I supposed to do?
another way:There might be better ways to do it, but I would do:
flag_last_a = False
for a in list:
if flag_last_a:
flag_last_a = False
continue
if a=='a':
flag_last_a = True
# Whatever is done when you don't skip
print itemahlongxp said:list=('a','d','c','d')
for a in list:
if a=='a' :
#skip the letter affer 'a'
what am I supposed to do?
Maybe,
it = iter(['a','d','c','d'])
for item in it:
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.