[Tutor] Help with Guess the number script

Mark Lawrence breamoreboy at yahoo.co.uk
Sat Mar 8 14:26:39 CET 2014


On 08/03/2014 01:23, Scott W Dunning wrote:
>
> On Mar 7, 2014, at 11:02 AM, Alan Gauld <alan.gauld at btinternet.com> wrote:
>
> GOT IT!!  Finally!  Thanks for all of your help!!

If at first you don't succeed... :)

>
> This is what I got, not sure if it’s correct but it’s working!
>
> def print_hints(secret, guess):
>      if guess < 1 or guess > 100:

Only now do I feel that it's time to point out that the above line would 
probably be written by an experienced Python programmer as:-

if 1 > guess > 100:

-- 
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.

Mark Lawrence

---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com




More information about the Tutor mailing list