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


Groups > comp.lang.python > #43016

Re: Newbie to python. Very newbie question

References <f0759987-4ff8-49a1-a826-4ae3f6508030@5g2000yqz.googlegroups.com> <alg3m81dohei58jefi5nmaumcdcvkma2pu@invalid.netcom.com> <5161C7C5.6000908@feete.org>
Date 2013-04-07 21:16 +0100
Subject Re: Newbie to python. Very newbie question
From Arnaud Delobelle <arnodel@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.253.1365365803.3114.python-list@python.org> (permalink)

Show all headers | View raw


On 7 April 2013 20:23, Ian Foote <ian@feete.org> wrote:
> I'm surprised no one has suggested:
>
>>>> import math
>>>> sum( x*x for x in range(1, int(math.sqrt(100)), 2))

Yeah! And I'm surprised no one came up with:

>>> from itertools import count, takewhile
>>> sum(takewhile((100).__gt__, filter((2).__rmod__, map((2).__rpow__, count(1)))))
165

:)

-- 
Arnaud

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


Thread

Newbie to python. Very newbie question ReviewBoard User <lalitha.viswanath@gmail.com> - 2013-04-07 04:16 -0700
  Re: Newbie to python. Very newbie question Kruno Saho <kruno.saho@gmail.com> - 2013-04-07 04:19 -0700
  Re: Newbie to python. Very newbie question Dave Angel <davea@davea.name> - 2013-04-07 07:50 -0400
  Re: Newbie to python. Very newbie question rusi <rustompmody@gmail.com> - 2013-04-07 10:02 -0700
  Re: Newbie to python. Very newbie question Miki Tebeka <miki.tebeka@gmail.com> - 2013-04-07 10:04 -0700
  Re: Newbie to python. Very newbie question Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-04-07 15:09 -0400
    Re: Newbie to python. Very newbie question Miki Tebeka <miki.tebeka@gmail.com> - 2013-04-07 16:57 -0700
  Re: Newbie to python. Very newbie question Ian Foote <ian@feete.org> - 2013-04-07 20:23 +0100
  Re: Newbie to python. Very newbie question Arnaud Delobelle <arnodel@gmail.com> - 2013-04-07 21:16 +0100
  Re: Newbie to python. Very newbie question Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-08 03:16 +0000

csiph-web