On Mon, 10 Oct 2016 10:56 am, Ian Kelly wrote:
> On Oct 9, 2016 2:57 PM, alleged:
> The Pythonic way
>
> if b >= a <= c:
> ...
I doubt that would be considered Pythonic by many people. Chained
comparisons are Pythonic, but not legal but weird combinations like
`a
On Mon, Oct 10, 2016 at 11:38 AM, Matt Wheeler wrote:
> On Mon, 10 Oct 2016, 00:56 Ian Kelly, wrote:
>
>> On Oct 9, 2016 2:57 PM, wrote:
>> The Pythonic way
>>
>> if b >= a <= c:
>> ...
>>
>>
>> Better:
>>
>> if a <= b <= c:
On Mon, 10 Oct 2016, 00:56 Ian Kelly, wrote:
> On Oct 9, 2016 2:57 PM, wrote:
> The Pythonic way
>
> if b >= a <= c:
> ...
>
>
> Better:
>
> if a <= b <= c:
> ...
>
That's not equivalent. Consider `a, b, c = 1, 7, 4`
> Using consistent
On Oct 9, 2016 2:57 PM, wrote:
On Sunday, October 9, 2016 at 2:41:41 PM UTC+1, BartC wrote:
> def min3(a,b,c):
> if a<=b and a<=c:
> return a
> elif b<=a and b<=c:
> return b
> else:
> return c
The Pythonic way
if b >= a <= c:
On 10/09/2016 05:01 AM, Cai Gengyang wrote:
def min3(a, b, c):
min3 = a
if b < min3:
min3 = b
if c < min3:
min3 = c
if b < c:
min3 = b
return min3
print(min3(4, 7, 5))
4
This is NOT a recommendation here, just a different way of looking
On Sunday, October 9, 2016 at 2:41:41 PM UTC+1, BartC wrote:
> On 09/10/2016 13:01, Cai Gengyang wrote:
> > I'm moving on to chapter 9
> > (http://programarcadegames.com/index.php?lang=en=lab_functions) of
> > programarcadegames for the time being and going back to chapter 8 later
> > (its just
On Mon, Oct 10, 2016 at 12:41 AM, BartC wrote:
> The exercise says you must use an if/elif chain. The first thing that comes
> to mind is:
>
> def min3(a,b,c):
> if a<=b and a<=c:
> return a
> elif b<=a and b<=c:
> return b
> else:
> return c
>
On 09/10/2016 13:01, Cai Gengyang wrote:
I'm moving on to chapter 9
(http://programarcadegames.com/index.php?lang=en=lab_functions) of
programarcadegames for the time being and going back to chapter 8 later (its just
fucking frustrating and doesn't seem to work for the time being and I have a
Cai Gengyang writes:
> I'm moving on to chapter 9
> (http://programarcadegames.com/index.php?lang=en=lab_functions)
> of programarcadegames for the time being and going back to chapter 8
> later (its just fucking frustrating and doesn't seem to work for the
> time being
I'm moving on to chapter 9
(http://programarcadegames.com/index.php?lang=en=lab_functions) of
programarcadegames for the time being and going back to chapter 8 later (its
just fucking frustrating and doesn't seem to work for the time being and I have
a very bad temper).
At least for chapter
10 matches
Mail list logo