4 # The algorithm is not efficient, but easy to understand.
5 # If there are large factors, it will take forever to find them,
6 # because we try all odd numbers between 3 and sqrt(n)...
11 error
= 'fact.error' # exception
14 if n
< 1: raise error
# fact() argument should be >= 1
15 if n
== 1: return [] # special case
17 # Treat even factors special, so we can use i = i+2 later
21 # Try odd numbers up to sqrt(n)
22 limit
= sqrt(float(n
+1))
37 for arg
in sys
.argv
[1:]: