This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author josh.r
Recipients Braiden Gole, josh.r, terry.reedy
Date 2018-05-02.01:40:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1525225227.15.0.682650639539.issue33404@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2018-05-02 01:40:27josh.rsetrecipients: + josh.r, terry.reedy, Braiden Gole
2018-05-02 01:40:27josh.rsetmessageid: <1525225227.15.0.682650639539.issue33404@psf.upfronthosting.co.za>
2018-05-02 01:40:27josh.rlinkissue33404 messages
2018-05-02 01:40:26josh.rcreate