for a in [1,2,3,4,5]: for b in [1,2,3]: if a == b: print("a = b = %s" % a) break # 退出本次for循环,执行第一行的for循环 else: print("a = %s" % a) continue # 继续执行第一行的for循环 print('现在输出a的值是',a) print('----------------------------') print("结束")