Josh Rosenberg <shadowranger+pyt...@gmail.com> added the comment: You named your loop variable i, overlapping the name of your second to last digit, so you end up replacing the original value of i in each (given the break, the only) loop.
So before the loop begins, i has the expected value of '6', but on the first iteration, i is rebound to the value of a (the first element in the tuple), '5', and your format string uses that value instead. If you removed the break, you'd see the second to last digit cycle through all the other values as it goes, because i would be repeatedly rebound to each digit as it goes. This is a bug in your code, not a problem with Python; in the future, direct questions of this sort to other online resources (e.g. Stack Overflow); unless you have a provable bug in Python itself, odds are it's a bug in your code's logic. ---------- nosy: +josh.r _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue33404> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com