Project euler no. 3

2009-09-12 Thread Someone Something
Project euler (in case you don't know: projecteuler.net) I'm trying to do the third one and here's my current code: 1 def checkPrime (x): 2 factors=2; 3 while factors=x: 4 if x==factors: 5 return True; 6 elif x%factors==0: 7 return

Re: Project euler no. 3

2009-09-12 Thread MRAB
Someone Something wrote: Project euler (in case you don't know: projecteuler.net http://projecteuler.net) I'm trying to do the third one and here's my current code: 1 def checkPrime (x): 2 factors=2; 3 while factors=x: 4 if x==factors: 5 return True; 6

Re: Project euler no. 3

2009-09-12 Thread Someone Something
But, I'm returning true or false right? On Sat, Sep 12, 2009 at 11:32 AM, MRAB pyt...@mrabarnett.plus.com wrote: Someone Something wrote: Project euler (in case you don't know: projecteuler.net http://projecteuler.net) I'm trying to do the third one and here's my current code: 1 def

Re: Project euler no. 3

2009-09-12 Thread MRAB
Someone Something wrote: But, I'm returning true or false right? No. If you don't explicitly return a value then None will be returned. On Sat, Sep 12, 2009 at 11:32 AM, MRAB pyt...@mrabarnett.plus.com mailto:pyt...@mrabarnett.plus.com wrote: Someone Something wrote: Project

Re: Project euler no. 3

2009-09-12 Thread Kee Nethery
in checkPrime what do you return when x is less than 2? On Sep 12, 2009, at 8:46 AM, Someone Something wrote: But, I'm returning true or false right? On Sat, Sep 12, 2009 at 11:32 AM, MRAB pyt...@mrabarnett.plus.com wrote: Someone Something wrote: Project euler (in case you don't know:

Re: Project euler no. 3

2009-09-12 Thread Someone Something
Anyone? On Sat, Sep 12, 2009 at 11:46 AM, Someone Something fordhai...@gmail.comwrote: But, I'm returning true or false right? On Sat, Sep 12, 2009 at 11:32 AM, MRAB pyt...@mrabarnett.plus.com wrote: Someone Something wrote: Project euler (in case you don't know: projecteuler.net

Re: Project euler no. 3

2009-09-12 Thread Dave Angel
Kee Nethery wrote: div class=moz-text-flowed style=font-family: -moz-fixedin checkPrime what do you return when x is less than 2? On Sep 12, 2009, at 8:46 AM, Someone Something wrote: But, I'm returning true or false right? On Sat, Sep 12, 2009 at 11:32 AM, MRAB pyt...@mrabarnett.plus.com