if <condition> : statment elif <condition> : statment else : pass
while <condition>: statement
开始1到3,不包括3,步数1
for i in range(1, 3, 1): print(i) else: # for 循环正常执行完成后执行 else 语句, break 退出时不会执行 print()
max = a if a > b else b
Last updated 5 years ago
Was this helpful?