loading
open in
main.py
1
2
3
4
5
6
7
8
n = int(input('The largest prime factor of ')) 
p = 2
while p*p <= n:      
  if n % p == 0: 
    n //= p
  else: 
    p+= 2 if p>2 else 1   # after 2, consider only odd p
print "is", n