I am adding a simple print variable line to a program and it is giving me an IndentationError. Code works with the "print yes" line commented out as shown, but when I uncomment I get the error:
Error:
factors.append(yes)
^
IndentationError: unexpected indent
Code:
n = 1
x = int(raw_input("What is the number you would like largest prime factor of?"))
factors= []
checklist = []
primefactors = []
while n < (x+1)/2:
if x % n == 0:
yes = n
#print yes
factors.append(yes)
if n % 1000 == 0:
print "running n count = %s" % (n)
n += 1
for j in factors:
checklist = [j]
for i in range(2, j):
if j % i == 0:
checklist.append(j/i)
if len(checklist) == 1:
primefactors.append(checklist)
print "All factors of %s are %s" % (x,factors)
print "The prime factors are %s" % (primefactors)
print "The highest prime factor is %s" % (max(primefactors))