[Tutor] Help with Guess the number script
Dave Angel
davea at davea.name
Sat Mar 8 14:36:39 CET 2014
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.
--
DaveA
More information about the Tutor
mailing list