Skip to content

Instantly share code, notes, and snippets.

@BedirYilmaz
Created October 11, 2016 10:45
Show Gist options
  • Save BedirYilmaz/3bdcd79c7fce9fadf843273039c83e56 to your computer and use it in GitHub Desktop.
Save BedirYilmaz/3bdcd79c7fce9fadf843273039c83e56 to your computer and use it in GitHub Desktop.
Listing the prime factors of given number
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