Hey, I'm new to python so don't judge.

Dennis Lee Bieber wlfraed at ix.netcom.com
Tue Jan 3 05:31:22 EST 2017


On Tue, 3 Jan 2017 18:47:43 -0800 (PST), Callum Robinson
<cr2001 at hotmail.co.nz> declaimed the following:


>
>hello.
>I have thought of a number between 1 and 100.
>Can you guess it?
>5
>Low
>Sorry , you are too high. Try again.
>
>Does this mean the number i entered is to low but the code is still stating it
is to high?

        Is that a cut&paste from some console window, or are you just retyping
what you think it did?

        Nothing in your previous code produces the word "Low" -- it will
produce "low" (notice the case).

        And where in your code do you test for that return word?


        To simplify things -- don't return words from your function... change
it to return +1 for high, -1 for low, and 0 for "win".

        Then figure out how to modify the main loop to use those integers...

--
        Wulfraed                 Dennis Lee Bieber         AF6VN
    wlfraed at ix.netcom.com    HTTP://wlfraed.home.netcom.com/



More information about the Python-list mailing list