frustrated stupid newbie question

Sheila King usenet at thinkspot.net
Tue Mar 12 18:27:36 EST 2002


[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