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则执行==")
本文共 306 字,大约阅读时间需要 1 分钟。
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则执行==")
转载于:https://www.cnblogs.com/wf-skylark/p/9009758.html