On Oct 9, 2016 2:57 PM, <breamore...@gmail.com> 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:
    ...


Better:

if a <= b <= c:
    ...

Using consistent operators is not required but is easier to read and less
confusing.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to