frustrated stupid newbie question

John Purser NO_SPAM_jmpurser2 at attbi.com
Tue Mar 12 18:59:15 EST 2002


I tried the same code and got no result.  The code would run, ask me how
high it should check, then nothing.  I tried a bunch of  'print' statements
to see where it was dying but it never seemed to run the code below the
'input()' statement.

Something's going on here.

John


"Sheila King" <usenet at thinkspot.net> wrote in message
news:a6l6p9.3vs6ro7.1 at kserver.org...
> [posted and mailed]
>
> On Tue, 12 Mar 2002 16:59:13 -0600, "Scott Kurland" <skurland at juggler.net>
> wrote in comp.lang.python in article <u8t22ns5jo7i46 at corp.supernews.com>:
>
> > Why isn't this $%^*#$% program working?
>
> > #Searching for perfect numbers
> >
> > howhigh= input ("How high should I check?")
> > for number in range (1,howhigh):
> >  factorsum = 0
> >  halfnumber=number/2
> >  for checking in range (1,halfnumber):
> >   if number/checking == int (number/checking):
> >    factorsum = factorsum + checking
> >  if number == factorsum:
> >   print number
> >
>
> What do you mean it isn't working? It ran without crashing when I tried
it.
> Here is the output from a sample run:
>
> >>>
> How high should I check?50
> 10
>
> >>>
>
> Are you expecting some other type of output? What are you expecting?
>
>
> > Flame away, I can't feel dumber than this.
>
> Oh, now what newsgroup mistreated you so, that you would expect such a
> thing? We don't do that here in comp.lang.python!
>
> --
> Sheila King
> http://www.thinkspot.net/sheila/
> http://www.k12groups.org/
>





More information about the Python-list mailing list