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