Problem 3

Problem: 

The prime factors of 13195 are 5, 7, 13 and 29.

What is the largest prime factor of the number 600851475143 ?


My Solution:

#What is the largest prime factor of the number 600851475143 ?
def isprime(m):
    for j in range(2,int(m**0.5)+1):
        if m % j == 0:
            return False
    return True

for i in range(2,1000000): #betting its smaller than this...
    if n % i==0:
        if isprime(i):
            l.extend([i])

print max(l)