if条件判断的基本结构:
if 条件1: 语句1 elif 条件2: 语句2 else: 语句3
while循环:
while 循环条件: 语句
for循环:
# 示例一 li = ['one','two','three'] for item in li: print(item) # 示例二 for i in range(10): print(i)
if 条件1: 语句1 elif 条件2: 语句2 else: 语句3
while 循环条件: 语句
# 示例一 li = ['one','two','three'] for item in li: print(item) # 示例二 for i in range(10): print(i)