**
程序的逻辑:
** 一个让计算机按照既定计划或规则执行的流程即程序的逻辑 逻辑是程序的基石
程序逻辑的组成:逻辑语句与逻辑运算构成了程序的逻辑 
如何构建逻辑判断 if(逻辑运算-条件): (代码块) elif(逻辑运算-条件): (代码块) else: (代码块)
chengji = 30
if (chengji >= 90):
print("成绩优秀")
elif(chengji >= 60):
print("成绩及格")
else:
print("成绩不及格")`
 
**
程序的循环
** 循环是程序设计语言中反复执行某些代码的一种计算机处理过程,常见的有按照次数循环(for)和按照条件循环(while)。
*注:满足特定的条件而重复执行的一个或多个动作
##循环是一个“不知疲倦的劳工”,苦活累活都是他来干
1. for循环的构建和原理:
 
2. while循环的构建和原理


3. 循环控制语句 break continue pass
for i in range(0,10,2):
if i == 6:
break
print("当前为",i)
i = True
j = 0
while i:
while j < 10:
j += 1
if j < 10:
if j == 7:
continue
elif j == 9:
i = False
else:
print("现在j为", j)
else:
print("i、j的状态", i, "、", j)
print(j)
print("结束")
现在j为 1
现在j为 2
现在j为 3
现在j为 4
现在j为 5
现在j为 6
现在j为 8
i、j的状态 False 、 10
10
结束
for i in "python":
if i == "o":
pass
else:
print(i)
*注:如果 if for while 下无代码,系统会报错,可以用pass占位
4. for循环伴侣 range()函数

|