while中使用break和continue:
count=0##计数器
while True:
s=input('请输入内容:')
if s=='退出':
print(count)
print('退出!')
break##退出循环
if '生气' in s:
print(count)
continue##本次循环没结束,要求重新输入
count = count+1
print(count)
输出显示结果:
标签:count,##,break,while,continue,print From: https://www.cnblogs.com/libinghui/p/17810261.html