Created
February 20, 2012 15:54
-
-
Save jondavidjohn/1869816 to your computer and use it in GitHub Desktop.
Get Factors of a number
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _facs(num): | |
rv = [1, num] | |
for i in xrange(2, int(math.sqrt(num)) + 1): | |
if not num % i: | |
rv.extend([i,num/i]) | |
return rv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment