[Tutor] Help with Guess the number script
Scott dunning
swdunning at cox.net
Sat Mar 8 19:42:28 CET 2014
> On Mar 8, 2014, at 6:36 AM, Dave Angel <davea at davea.name> wrote:
>
> Mark Lawrence <breamoreboy at yahoo.co.uk> Wrote in message:
>>> On 08/03/2014 01:23, Scott W Dunning wrote:
>>>
>>>
>>> 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:
>
> With an appropriate 'not' or its equivalent, of course.
>
This is how our teacher wanted it all written under the print_hints function. Besides if I was an experienced python programmer I wouldn't be asking such trivial stuff under the tutor forum lol.
More information about the Tutor
mailing list