Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #32566 > unrolled thread

Re: pythonic way

Started byZero Piraeus <schesis@gmail.com>
First post2012-11-01 12:54 -0400
Last post2012-11-01 12:54 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: pythonic way Zero Piraeus <schesis@gmail.com> - 2012-11-01 12:54 -0400

#32566 — Re: pythonic way

FromZero Piraeus <schesis@gmail.com>
Date2012-11-01 12:54 -0400
SubjectRe: pythonic way
Message-ID<mailman.3159.1351788913.27098.python-list@python.org>
:

On 1 November 2012 11:32, inshu chauhan <insideshoes@gmail.com> wrote:
>  what is the most pythonic way to do this :
>
>                    if 0 < ix < 10 and 0 < iy < 10 ???

As everyone else has said, it's perfectly pythonic once you stick the
colon on the end. You might find it more instantly readable with some
extra parentheses:

    if (0 < ix < 10) and (0 < iy < 10):
        # do something

... but that's really just down to taste.

 -[]z.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web