遍历循环保留字

 

 

s="python"
while s!="":
for c in s:
if c=="t":
break
print(c,end='')
s=s[:-1]
输出结果:pypypypypyp

s="python"
while s!="":
for c in s:
if c=="t":
continue
print(c,end='')
s=s[:-1]
输出结果:pyhonpyhopyhpypyp

 

 

 


posted on 2019-03-01 23:01  smileBB  阅读(602)  评论(0编辑  收藏  举报