Created
October 11, 2016 10:45
-
-
Save BedirYilmaz/3bdcd79c7fce9fadf843273039c83e56 to your computer and use it in GitHub Desktop.
Listing the prime factors of given number
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
def primer(n): | |
notprime = False | |
for x in range(2 , n): | |
for y in range (2, x): | |
if x%y == 0: | |
notprime = True | |
break | |
if notprime == False and n % x == 0: | |
print(str(x) + " is prime and is a factor") | |
notprime = False | |
primer(600851475143) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment