hi I am trying problem 6 in projecteuler.org. What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?
def rr(z,m=1): q=lambda n:m%n==0 s=lambda False : 0 a=filter(s,map(q,range(1,z))) if not a: m+=1 rr(z,m) else:return m This code is going into endless loop. rr(z,m) File "<pyshell#1>", line 7, in rr rr(z,m) File "<pyshell#1>", line 7, in rr rr(z,m) File "<pyshell#1>", line 7, in rr rr(z,m) File "<pyshell#1>", line 7, in rr rr(z,m) File "<pyshell#1>", line 7, in rr rr(z,m) File "<pyshell#1>", line 7, in rr rr(z,m) File "<pyshell#1>", line 7, in rr rr(z,m) File "<pyshell#1>", line 7, in rr rr(z,m) File "<pyshell#1>", line 7, in rr rr(z,m) File "<pyshell#1>", line 7, in rr rr(z,m) File "<pyshell#1>", line 7, in rr rr(z,m) File "<pyshell#1>", line 7, in rr rr(z,m) File "<pyshell#1>", line 7, in rr rr(z,m) File "<pyshell#1>", line 7, in rr rr(z,m) File "<pyshell#1>", line 7, in rr rr(z,m) File "<pyshell#1>", line 7, in rr rr(z,m) File "<pyshell#1>", line 7, in rr rr(z,m) I tried dime a dozen permutations oF the code. Can some one show me why it is going into Endless loop? Thank you Prasad _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor