判断
if <条件判断1>:
<执行1>
elif <条件判断2>:
<执行2>
elif <条件判断3>:
<执行3>
else:
<执行4>
循环
for in 循环
names = ['Michael', 'Bob', 'Tracy']
for name in names:
print(name)
while 循环
sum = 0
n = 99
while n > 0:
sum = sum + n
n = n - 2
print(sum)
判断
if <条件判断1>:
<执行1>
elif <条件判断2>:
<执行2>
elif <条件判断3>:
<执行3>
else:
<执行4>
循环
for in 循环
names = ['Michael', 'Bob', 'Tracy']
for name in names:
print(name)
while 循环
sum = 0
n = 99
while n > 0:
sum = sum + n
n = n - 2
print(sum)