Python cannot count apparently

Joel Goldstick joel.goldstick at gmail.com
Sun Feb 7 14:46:33 EST 2021


On Sun, Feb 7, 2021 at 2:36 PM Philipp Daher via Python-list
<python-list at python.org> wrote:
>
> Hello,
>
> I recently coded this snippet of code:
> myString=„hello“
> for i in range(len(myString):
>      print(string[i])
>
> And now for the weird part:
>
> SOMETIMES, the output is this:
>
> hello
>
> And SOMETIMES, the output changes to:
>
> ohell
>
> WHY??? Why do I get different outputs with the EXACT SAME CODE?
>
> Can someone help me please? Thank you
> --
> https://mail.python.org/mailman/listinfo/python-list

Did you type the code using idle, or the default python interactive
console?  If you did, please do that again, and copy and paste your
code and the results here.  There is something amiss.

-- 
Joel Goldstick
http://joelgoldstick.com/blog
http://cc-baseballstats.info/stats/birthdays


More information about the Python-list mailing list