Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion pythonic way
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Tim Chase  
View profile  
 More options Nov 1 2012, 11:56 am
Newsgroups: comp.lang.python
From: Tim Chase <python.l...@tim.thechases.com>
Date: Thu, 01 Nov 2012 10:57:12 -0500
Local: Thurs, Nov 1 2012 11:57 am
Subject: Re: pythonic way
On 11/01/12 10:32, inshu chauhan wrote:

>  what is the most pythonic way to do this :

>                    if 0 < ix < 10 and 0 < iy < 10 ???

What's wrong with the syntax you provide?  It's perfectly pythonic:

  ix = 42
  yx = 3.14159
  if 0 < ix < 10 and 0 < iy < 10:
    do_stuff(ix, iy)
  else:
    do_other_stuff(ix, iy)

-tkc


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.