一 运算符
1.算数运算
2.比较运算
3.赋值运算
4.逻辑运算
and注解:
or注解:
and-or结合使用:
(1 and ‘x‘) or ‘y‘
5.运算符的优先级:自上而下,优先级从高到低
二.标准数据类型特性总结
三.流程控制
if 条件:
子代码1
子代码2
子代码3
(1)
age= int(input(‘您芳龄几何>>:‘))
sex= input(‘您的性别是>>:‘)
if sex == ‘female‘or age > 50:
print(‘alex很中意你,我们结婚吧‘)
else:
print(‘不是我的菜‘)
(2)
(3)
‘‘‘
90及以上 : A
80分以上90以下 : B
70分以上80以下 : C
60分以上70以下 : D
60以下 : E
‘‘‘

简洁的一种

while循环
while 条件:
循环体的代码1
循环体的代码2
循环体的代码3
count=0
while count < 10:
print(count)
count+=1
while True: #死循环
print(‘ok‘)
while 1: #死循环
print(‘ok‘)
break:跳出本层循环
count=0
while count < 10:
if count == 5:
break
print(count)
count+=1
continue:跳出本次循环
0 1 2 3 7 8 9
count=0
while count < 10:
if count >=4 and count <=6:
count += 1
continue
print(count)
count+=1
eg:
原文:http://www.cnblogs.com/shaojiafeng/p/7200899.html