Wikibooks example doesn't work
Larry Hudson
orgnut at yahoo.com
Thu Aug 7 00:59:12 EDT 2014
On 08/06/2014 08:48 PM, Seymore4Head wrote:
> On Thu, 07 Aug 2014 13:43:40 +1000, Steven D'Aprano
> <steve+comp.lang.python at pearwood.info> wrote:
>
>> Seymore4Head wrote:
>>
>>> On Wed, 06 Aug 2014 22:58:51 -0400, Seymore4Head
>>> <Seymore4Head at Hotmail.invalid> wrote:
>>>
[snip]
>> Ah, now things make sense! Your subject line is misleading! It's not that
>> the wikibooks example doesn't work, the example works fine. It's that the
>> code you added to it doesn't do what you expected. You should have said.
>>
> I copied it verbatim from the web page's solution. After indenting as
> you suggested, it does work now though.
> Thanks
>
>>
>>> A counter is added to give 3 tries to guess the number.
>>> It is supposed to stop after count gets to 3. It doesn't. It just
>>> keeps looping back and asking for another guess.
>>
I just took a look at that web page, and I see what your problem actually is...
You are misunderstanding the problem. The problem does NOT say to end the loop at three tries,
just to keep track of the number of tries. It's not actually specific, but the implication is
that AFTER the loop display a message depending on the number of actual tires.
The wikibooks solution IS correct, you understanding of the stated problem is not.
My response here may sound harsh but I don't mean it to be, so please don't take it that way.
Python is a great language to learn -- keep it up, you'll get it! :-)
-=- Larry -=-
More information about the Python-list
mailing list