Project Euler Problem 3 - Python

This is the third Project Euler problem solved using Python.

# euler3.py
# 
# The prime factors of 13195 are 5, 7, 13, and 29.
# What is the largest prime factor of the number 600851475143?

n = 600851475143
factor = 3    # because we don't need to check 1 or 2

while (n > 1):
    if (n%factor == 0):
        n/=factor
    else:
        factor = factor + 2

print factor