On Mar 7, 2014, at 11:02 AM, Alan Gauld wrote:
GOT IT!! Finally! Thanks for all of your help!!
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:
print
print "Out of range!"
print
if gues
On 08/03/14 01:23, Scott W Dunning wrote:
On Mar 7, 2014, at 11:02 AM, Alan Gauld wrote:
GOT IT!! Finally! Thanks for all of your help!!
This is what I got, not sure if it’s correct but it’s working!
Well done.
And now that you have the right set of tests you can
half the number of lines
On 03/08/2014 10:13 AM, Alan Gauld wrote:
On 08/03/14 01:23, Scott W Dunning wrote:
On Mar 7, 2014, at 11:02 AM, Alan Gauld wrote:
GOT IT!! Finally! Thanks for all of your help!!
This is what I got, not sure if it’s correct but it’s working!
Well done.
And now that you have the right set
On 08/03/2014 01:23, Scott W Dunning wrote:
On Mar 7, 2014, at 11:02 AM, Alan Gauld 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 <
Mark Lawrence 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:-
On Sat, Mar 8, 2014 at 8:36 AM, Dave Angel wrote:
> Mark Lawrence 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
>> probab
On 08/03/2014 14:29, eryksun wrote:
Anyway, you needn't go out of your way to rewrite the expression using
a chained comparison. The disjunctive expression is actually
implemented more efficiently by CPython's compiler, which you can
verify using the dis module to disassemble the bytecode.
I h
> On Mar 8, 2014, at 6:36 AM, Dave Angel wrote:
>
> Mark Lawrence 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
> On Mar 8, 2014, at 6:26 AM, Mark Lawrence wrote:
>
>> On 08/03/2014 01:23, Scott W Dunning wrote:
>>
>> On Mar 7, 2014, at 11:02 AM, Alan Gauld 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 i
> On Mar 8, 2014, at 3:57 AM, spir wrote:
>
>> On 03/08/2014 10:13 AM, Alan Gauld wrote:
>>> On 08/03/14 01:23, Scott W Dunning wrote:
>>>
>>> On Mar 7, 2014, at 11:02 AM, Alan Gauld wrote:
>>>
>>> GOT IT!! Finally! Thanks for all of your help!!
>>>
>>> This is what I got, not sure if it’s
On Sat, Mar 8, 2014 at 1:44 PM, Scott dunning wrote:
>> if 1 > guess > 100:
>>
> OH! I see what you're saying, ignore my last post. Yes that looks
> cleaner.
Please read section 6.9 of the language reference, which defines
Python comparison expressions.
http://docs.python.org/3/reference/expre
11 matches
Mail list logo