Iteration for Factorials

Marco Mariani marco at sferacarta.com
Tue Oct 30 11:53:49 CET 2007


Nick Craig-Wood wrote:

> Note you can write your middle loop as
> 
>     for i in range(I):
>         number = myNumer[:]
>         random.shuffle(number)
>         if number == myNumer:
>             count+=1

Nice. Try 'em all, then count 'em.

Another wtfery would be a SQLAlchemy solution, generating dynamic 
queries, using only OUTER JOINs and COUNT(). Could be a way to justify 
hardware upgrades.





More information about the Python-list mailing list