In article <46758542-1bd6-43fe-8e80-bcf14b7d8...@pi6g2000pbc.googlegroups.com>, sl33k <ahsanbag...@gmail.com> wrote:
>I'm trying project euler problem 3 and I've hit the wall with this >error. What could be the problem here? > > l=[] >>>> num=600851475143 >>>> i=1 >>>> while i<=num: >... if num%i==0: >... l.append(i) >... i+=1 >... print max(l) > File "<stdin>", line 5 > print max(l) > ^ >SyntaxError: invalid syntax You have to insert an empty line after the end of the while loop (before the print command), so that the interpreter can run and finish the loop before it is to print the result. Best regards, Günther -- http://mail.python.org/mailman/listinfo/python-list