On 23/03/17 10:15, Richard Mcewan wrote:
> #loop to check guess and report
> while userGuess != computerGuess:
> if userGuess < computerGuess:
> print('Too low')
> userGuess = getUser()
> elif userGuess > computerGuess:
> print('Too high')
>
Hi
Thanks Mats, Joel and Alan for helpful advice.
This code (below) behaves as I wanted now. And think I see where I was going
wrong with functions.
Thank you very much.
Richard
Ps I'll reflect on appropriate variable names also.
# coding: utf-8
import random
#guess number game
#compute
On 03/22/2017 03:17 PM, Richard Mcewan wrote:
> Hi
>
> I wonder if you can help.
>
> I'm confused about how functions should work. Below is some code I write to
> check my understanding.
>
> I'm expecting two functions to be defined. Then called. One returns a random
> number. The other user
On 22/03/17 21:17, Richard Mcewan wrote:
> I'm expecting two functions to be defined. Then called.
And thats what you've got. But...
> One returns a random number. The other user input (guessing the number).
And thats also what you've got but you don't do anything
with the returned value you
On Wed, Mar 22, 2017 at 5:17 PM, Richard Mcewan wrote:
> Hi
>
> I wonder if you can help.
>
> I'm confused about how functions should work. Below is some code I write to
> check my understanding.
>
> I'm expecting two functions to be defined. Then called. One returns a random
> number. The other
Hi
I wonder if you can help.
I'm confused about how functions should work. Below is some code I write to
check my understanding.
I'm expecting two functions to be defined. Then called. One returns a random
number. The other user input (guessing the number).
I expect the return values to ac