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


Groups > comp.lang.python > #56555

Re: Python's and and Pythons or

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.093
X-Spam-Evidence '*H*': 0.87; '*S*': 0.05; 'subject:Python': 0.06; 'none,': 0.07; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'reedy': 0.16; 'appropriate': 0.16; 'wrote:': 0.18; 'figures': 0.19; 'thu,': 0.19; 'example.': 0.24; 'header:In- Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'received:google.com': 0.35; 'there': 0.35; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'extremely': 0.39; 'to:addr:python.org': 0.39; "you're": 0.61; 'show': 0.63; 'effectively': 0.66; '=====': 0.84; 'average': 0.93; '2013': 0.98
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=S55YvlVndWnFcIMs40ETO81Z8WFd9hT4/5z/TNt0YB0=; b=tOnI/W9Dz/HbDYtWV9eI1ik4KQNRN6UlITX+qvg6iGn5roItNlOK8zBZjFovK0A3iv rY9in2dyktdALlSeGKMCMSX074olSYTmEEnj7Q5LweAfhLNbkkSDOMiYEc2Fh0/IW2Yi V9n8H8TzyTgo+9btI1qXYUpLxmrhByR21XfDqN8sRkhqhTFn5qOLw9P9pDwYiWK0XCQP 6oVACBT757xk4ehNGaMxhuGBXNz3p762lQ+5iL3Zj9JtoBHjO4TQukjEmW6ucpcn7GJK FUmaE2VP4mvCLr65O16CPJ0exSXgv2L5trTbMu10GDkgoJ/Pt+UYAy4N9TQhKeLPmhQy bu7A==
MIME-Version 1.0
X-Received by 10.68.96.130 with SMTP id ds2mr12307906pbb.99.1381392181364; Thu, 10 Oct 2013 01:03:01 -0700 (PDT)
In-Reply-To <l35lqd$jh2$1@ger.gmane.org>
References <91180c35-413f-4b65-a224-917d8d68b7ec@googlegroups.com> <a471eecd-2e9f-4d32-8825-bdc088a0ecb0@googlegroups.com> <CAPTjJmrnw9kSuCG0cJrNeGF7A=ge-R0izj75J1QTTBHkPtNuyw@mail.gmail.com> <l35lqd$jh2$1@ger.gmane.org>
Date Thu, 10 Oct 2013 19:03:01 +1100
Subject Re: Python's and and Pythons or
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.929.1381392190.18130.python-list@python.org> (permalink)
Lines 18
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1381392190 news.xs4all.nl 15872 [2001:888:2000:d::a6]:49316
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:56555

Show key headers only | View raw


On Thu, Oct 10, 2013 at 6:43 PM, Terry Reedy <tjreedy@udel.edu> wrote:
> y = x and 1/x
> One just has to remember that y==0 effectively means y==+-infinity ;-).

Good example. Extremely appropriate to situations where you're showing
a set of figures and their average:

Foo   1
Bar   3
Quux  7
Asdf  9
===== 5

Let the average show as zero if there are none, it won't hurt:

print("=====",count and total/count)

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Python's and  and Pythons or Peter Cacioppi <peter.cacioppi@gmail.com> - 2013-10-09 16:54 -0700
  Re: Python's and  and Pythons or Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-10-10 00:36 +0000
    Re: Python's and and Pythons or Chris Angelico <rosuav@gmail.com> - 2013-10-10 12:13 +1100
  Re: Python's and  and Pythons or Peter Cacioppi <peter.cacioppi@gmail.com> - 2013-10-09 23:12 -0700
    Re: Python's and and Pythons or Chris Angelico <rosuav@gmail.com> - 2013-10-10 17:45 +1100
    Re: Python's and  and Pythons or Ethan Furman <ethan@stoneleaf.us> - 2013-10-09 23:46 -0700
    Re: Python's and and Pythons or Terry Reedy <tjreedy@udel.edu> - 2013-10-10 03:43 -0400
    Re: Python's and and Pythons or Chris Angelico <rosuav@gmail.com> - 2013-10-10 19:03 +1100
    Re: Python's and and Pythons or Ethan Furman <ethan@stoneleaf.us> - 2013-10-10 06:33 -0700
    Re: Python's and and Pythons or Terry Reedy <tjreedy@udel.edu> - 2013-10-10 21:41 -0400
    Re: Python's and and Pythons or Ethan Furman <ethan@stoneleaf.us> - 2013-10-10 19:47 -0700
  Re: Python's and  and Pythons or Peter Cacioppi <peter.cacioppi@gmail.com> - 2013-10-09 23:55 -0700

csiph-web