Python Control Statements: break and continue
1. break The function of break: used to end the entire loop Can only be used in loops; it cannot be used independently In nested loops, it only affects the innermost loop demo: In [1]: name = 'yuque' …: …: for x in name: …: print('—-') …: if x == 'q': …: break …: print(x) … Read more