name = 'hello'
for x in name:
    print(x)
    if x == 'l':
        break      #退出for循环
else:
    print("==for循环过程中,如果没有break则执行==")



name = 'hello'
for x in name:
    print(x)
    #if x == 'l':
    #    break #退出for循环
else:
    print("==for循环过程中,如果没有break则执行==")

  

相关文章:

  • 2022-12-23
  • 2021-10-30
  • 2021-05-11
  • 2021-11-06
  • 2021-11-27
猜你喜欢
  • 2022-12-23
  • 2022-01-23
  • 2021-07-28
  • 2021-12-21
  • 2021-10-24
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案