En Thu, 25 Oct 2007 00:40:12 -0300, sandipm <[EMAIL PROTECTED]>
escribi�:
> thanks..I am using python 2.4.4. so i couldnt find "all" either as
> inbuilt module
> or by doing "from itertools import *", "all" is not available.
> I think I need to move to 2.5 then
It's easy to write in pure
thanks..I am using python 2.4.4. so i couldnt find "all" either as
inbuilt module
or by doing "from itertools import *", "all" is not available.
I think I need to move to 2.5 then
but what are the pros/cons of moving to 2.5? as we are using 2.4.4 on
production server which is quite stable.
a
>> Is "all" inbuilt function in python? what it does?
>
help(all)
> Help on built-in function all in module __builtin__:
>
> all(...)
> all(iterable) -> bool
>
> Return True if bool(x) is True for all values x in the iterable.
It may be helpful to know that any() and all() were ad
On Oct 24, 5:03 pm, sandipm <[EMAIL PROTECTED]> wrote:
> Is "all" inbuilt function in python? what it does?
>>> help(all)
Help on built-in function all in module __builtin__:
all(...)
all(iterable) -> bool
Return True if bool(x) is True for all values x in the iterable.
--
Paul Hankin
hi,
Is "all" inbuilt function in python? what it does?
> from itertools import ifilter, count
>
> def anagram_finder():
> primes = ifilter(lambda p: all(p % k for k in xrange(2, p)), count(2))
> primeAlpha = dict(zip(string.lowercase, primes))
>
On Oct 24, 2:28 am, Paul Hankin <[EMAIL PROTECTED]> wrote:
> On Oct 23, 9:21 am, [EMAIL PROTECTED] wrote:
>
> > This one uses a dictionary to store prime values of each letter in the
> > alphabet and for each line multiple the results of the characters
> > (which is unique for each anagram) and add
On Oct 23, 9:21 am, [EMAIL PROTECTED] wrote:
> This one uses a dictionary to store prime values of each letter in the
> alphabet and for each line multiple the results of the characters
> (which is unique for each anagram) and add them to a dictionary for
> printing latter.
>
> def anagram_finder()
echniques.
>
> > For the wordlist go to this link http://codekata.pragprog.com/
> > 2007/01/kata_six_anagra.html">Kata Anagrams
> > Anyway here are my two examples.
>
> > This one uses a dictionary to store prime values of each letter in the
> > alphabet and fo
interested in other techniques people have (without
> resorting to overusage of C modules and such like), just python and
> good computer science techniques.
>
> For the wordlist go to this link http://codekata.pragprog.com/
> 2007/01/kata_six_anagra.html">Kata Anagrams
> Anyw
ge of C modules and such like), just python and
good computer science techniques.
For the wordlist go to this link http://codekata.pragprog.com/
2007/01/kata_six_anagra.html">Kata Anagrams
Anyway here are my two examples.
This one uses a dictionary to store prime values of each letter in
10 matches
Mail list logo