代码示例:(标识:python_ref_keyword_break_2)
python_ref_keyword_break_2.py
i = 1
while i < 9:
  print(i)
  if i == 5:
    break
  i += 1
运行结果: