2012/3/10 sl33k <ahsanbag...@gmail.com>: > 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 > > > -- > http://mail.python.org/mailman/listinfo/python-list
Hi, if you are using python 3, you'd (most likely) need to adapt the code written for python 2. see: http://docs.python.org/py3k/whatsnew/3.0.html#print-is-a-function hth, vbr -- http://mail.python.org/mailman/listinfo/python-list