Re: Anagrams

2007-10-28 Thread Gabriel Genellina
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

Re: Anagrams

2007-10-24 Thread sandipm
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

Re: Anagrams

2007-10-24 Thread Tim Chase
>> 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

Re: Anagrams

2007-10-24 Thread Paul Hankin
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

Re: Anagrams

2007-10-24 Thread sandipm
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)) >

Re: Anagrams

2007-10-24 Thread cokofreedom
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

Re: Anagrams

2007-10-23 Thread Paul Hankin
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()

Re: Anagrams

2007-10-23 Thread [EMAIL PROTECTED]
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

Re: Anagrams

2007-10-23 Thread [EMAIL PROTECTED]
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

Anagrams

2007-10-23 Thread cokofreedom
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