//条件为真时才为X否则为y
small = x if x>y else y
#不会报错
assert 3<4
#抛出错误,程序终止
assert 3>4
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AssertionError
while condition
循环体
teacher = "johnshuxian"
for each in teacher:
print(each,end='')
#打印0到4不包含5
for i in range(5):
print(i)
#打印5,7,9
for i in range(5,10,2)
print(i)