标签:else exit 循环 family 语句块 while input 语句 ali
# while循环语句
# if True:
# print(‘hello‘)
# while True:
# print(‘hello‘)
"""
while <条件> 如果条件为True,那么会重复运行while语句块中的内容。
如果while循环的条件一直未True,死循环
"""
# while True:
# number = 20
# user_number = int(input(‘请输入一个数字‘))
# if user_number < number:
# print(‘猜小了‘)
# elif user_number > number:
# print(‘猜大了‘)
# else:
# print(‘猜对了‘)
# exit()
# while 后的条件变化着
num = 0
while num < 10:
print(num)
num += 1 #简写
print
标签:else exit 循环 family 语句块 while input 语句 ali
原文地址:https://www.cnblogs.com/psy0508/p/9846598.html