"""
循环两要素:
循环次数 循环变量--赋初值 循环条件 循环步进
循环操作
"""
"""
循环变量赋初值
while 循环条件:
循环体
循环变量步进
"""
#打印五遍hellowrold
# i = 1
# while i <= 5:
# print("hellowrold!")
# i += 1 #i = i + 1
#打印0~9之间的整数
# i = 0
# while i <= 9:
# print(i,end = " ")
# i += 1 #i = i + 1
print() #括号里面什么都没写相当于换行符\n
#计算0~100之间所有整数的和
# i = 0
# sum = 0
# while i <= 100:
# sum += i
# i += 1 #i = i + 1
# #print(sum)
# print(f"sum={sum}")
#计算0~100之间所有偶数的和
# #1.
# i = 0
# sum = 0
# while i <= 100:
# sum += i
# i += 2 #i = i + 2
# print(f"sum={sum}")
# #2.
# i = 0
# sum = 0
# while i <= 100:
# if i%2 == 0:
# sum += i
# i += 1 #i = i + 1
# #print(sum)
# print(f"0~100之间所有偶数的和是{sum}")
#统计0~100之间能够被3或着7整除,但是不能同时被3和7整除的数的个数
i = 0
count = 0
while i <= 100:
if (i%3 == 0 or i%7 == 0) and (not(i%3 == 0 and i%7 == 0)):
print(i,end = " ")
count += 1
i += 1
print(f"满足条件的数的个数是{count}")