Redo for loop iteration in Python

No, Python doesn’t have direct support for redo. One option would something faintly terrible involving nested loops like: for x in mylist: while True: … if shouldredo: continue # continue becomes equivalent to redo … if shouldcontinue: break # break now equivalent to continue on outer “real” loop … break # Terminate inner loop any … Read more