Re: [Tutor] To find the least number divisible by all numbers from 1-20

2013-08-13 Thread Alan Gauld
On 13/08/13 18:19, Alan Gauld wrote: On 13/08/13 17:45, #PATHANGI JANARDHANAN JATINSHRAVAN# wrote: def check(num): lis=[20,19,18,17,16,14,13,11] #because a no. divisible by 20 is for i in lis: if num%i==0: continue else: return False break return True

Re: [Tutor] To find the least number divisible by all numbers from 1-20

2013-08-13 Thread Alan Gauld
On 13/08/13 17:45, #PATHANGI JANARDHANAN JATINSHRAVAN# wrote: def check(num): lis=[20,19,18,17,16,14,13,11] #because a no. divisible by 20 is for i in lis: if num%i==0: continue else: return False break return True This is a bit convoluted. All you nee

Re: [Tutor] To find the least number divisible by all numbers from 1-20

2013-08-13 Thread Marc Tompkins
On Tue, Aug 13, 2013 at 9:45 AM, #PATHANGI JANARDHANAN JATINSHRAVAN# < jatinshr...@e.ntu.edu.sg> wrote: > Hello All, > > Sorry for the earlier mail without subject. I was in a hurry so I missed > that > > I am solving problem number 5 in project euler. I think my solution > seems logically corre

[Tutor] To find the least number divisible by all numbers from 1-20

2013-08-13 Thread #PATHANGI JANARDHANAN JATINSHRAVAN#
Hello All, Sorry for the earlier mail without subject. I was in a hurry so I missed that I am solving problem number 5 in project euler. I think my solution seems logically correct but it is not giving an answer as it is taking too long to execute. So can someone suggest an alternative solution