L2.十.break

#  需求:   软件需要退出的功能。循环中达到我们想要的条件时退出。节省计算机资源
# 循环的中断


while True:
s = input('随便输入点什么:')

if s == 'quit':
break # 退出循环 breank


print('你输出的字符串长度是{}'.format(len(s))) #len(对象,扩住字符串): 返回对象的长度。
print('完')
posted @ 2018-11-02 18:42  pypi111258  阅读(126)  评论(0编辑  收藏  举报