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则执行==")
2023-11-07 16:39:40
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则执行==")