1.while循环结束语句。
方法有2
第一种 改变条件
flag =True
count=1
while flag:
count=count+1
print(count)
if count==101
flag=false
第二种 在语句中加入break
while True
count=count+1
print(count)
if count==101
break
中断循坏其中break和continue是不一样的
1.break出现整个while语句将会中断,2.continue出现在while语句中将中断之后的循环前面的语句
while True
print(111)
print(222)
continue
print(333)这排不会出现命令一直会循环上面两行。
unt=1 while count<5: print(count) count=count+1 else: print(666) print(222)
name =input('请问你的名字:') old=input('请问你多大:') jieshao='我是%s, 年芳%s'%('name,old') print(jieshao)
逻辑运算符