Ramesh Sahoo <rameshsaho...@gmail.com> added the comment:
Additional note: The following program completes all 5 iterations. #!/usr/bin/python3 stack = [s for s in range(5)] c = 0 for i in stack: c += 1 print(f"{'='*10} loop {c} {'='*10}") if i == 0 or i == 1 or i == 2: print(f"{i}\n") else: print(f"{i}\n") $ python3 test1.py ========== loop 1 ========== 0 ========== loop 2 ========== 1 ========== loop 3 ========== 2 ========== loop 4 ========== 3 ========== loop 5 ========== 4 ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue41518> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com