输出1 2 3 4 5 6 8 9
count=1
while count<11:
if count==7:
pass
else:
print(count)
count=count+1
输出1+....+100=的结果
count=1
ad=0
while count<101:
count=count+1
ad=ad+count
print(ad)
输出1-100内所有奇数
count=1
while count<100:
if count%2==1:
print(count)
else:
pass
count=count+1
输出1-100内所有偶数
count=1
while count<101:
if count%2==0:
print(count)
else:
pass
count=count+1
输出1-2+3......99的值:
count=1
al=0
while count<100:
if count%2==1:
al=al+count
else:
al=al-count
count=count+1
print(al)
3次判断:
count=0
while count<3:
a = input("please input the passport!")
if a==1:
print(‘welcome!‘)
count=3
else:
print("sorry!you are wrong!")
count=count+1
print(‘over!‘)
原文:https://www.cnblogs.com/chb420/p/12700999.html