Created
November 17, 2015 11:18
-
-
Save popey456963/c19304272f838719c996 to your computer and use it in GitHub Desktop.
primes
This file contains hidden or 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
import math | |
def factors(number): | |
return [(x, number / x) for x in range(int(math.sqrt(number)))[2:] if not number % x] | |
import time | |
start_time = time.time() | |
print(factors(543340953458958439)) | |
print("--- %s seconds ---" % (time.time() - start_time)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment