[issue33404] Phone Number Generator

Braiden Gole report at bugs.python.org
Tue May 1 22:41:05 EDT 2018


Braiden Gole <bmxfiend1 at gmail.com> added the comment:

Thanks for the detailed explenation and my apologies. I will contact
Stack Overflow in the future when I have an issue. This is my first report
in the bug section of Python and I now understand the content that needs to
be put under a category like this one.

Thanks: Braiden Gole

On Tue, May 1, 2018, 9:40 PM Josh Rosenberg, <report at bugs.python.org> wrote:

>
> Josh Rosenberg <shadowranger+python at 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 <report at bugs.python.org>
> <https://bugs.python.org/issue33404>
> _______________________________________
>

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33404>
_______________________________________


More information about the Python-bugs-list mailing list