5.replace的用法,while循环,continue

1.relace
s='dadk12'

print(s.replace('生活','dd'))打印返回dadk12,即使没有也不会报错。
2.while continue
while循环输出 1 2 3 4 5 6 8 9 10
(1)
count=1
while count<11:
if count
7:
continue#这里的continue打印到6就会停止
print(count)
count +=1
(2).
count=1
while count<11:
if count7:
pass
else:
print(count)
count +=1
(3).
count=0
while count<10:
count +=1
if count
7:
continue
print(count)

posted @ 2019-06-08 12:15  God_with_us  阅读(378)  评论(0编辑  收藏  举报