Hi Alan.
Thanks a lot. It worked
> --
>
> Message: 2
> Date: Sat, 26 Apr 2008 13:46:39 +0100
> From: "Alan Gauld" <[EMAIL PROTECTED]>
> Subject: Re: [Tutor] Help with Recurring Function
> To: tutor@python.org
> Messag
"Sanhita Mallick" <[EMAIL PROTECTED]> wrote
being calculated correctly as checked by the "print"
statement. But when we do
norm_ted = (2 * ted) / mag
It might be an integer division issue.
Try
norm_ted = (2*ted) / float(mag)
Just a thought...
--
Alan Gauld
Author of the Learn to
Hi Kent.
sum_norm_ted is sum over each i, and all j. That is
why it is initialize to zero at the beginning of each
i loop.
The inner loop IS running - which I checked by all the
print statements. The value of "ted" and "mag" ARE
being calculated correctly as checked by the "print"
statement. But
Sanhita Mallick wrote:
I am struggling with a simple recurring function
What is a recurring function? Do you mean looping?
Here is the script. T(i) are trees (as in graphs).
The program operates great, until the step where
norm_ted is calculated. Mysteriously norm_ted becomes
0, even though
Sanhita Mallick wrote:
Hi.
I am struggling with a simple recurring function, but
can't understand why this is happening. Please help.
Here is the script. T(i) are trees (as in graphs).
The program operates great, until the step where
norm_ted is calculated. Mysteriously norm_ted becomes
0, even
Hi.
I am struggling with a simple recurring function, but
can't understand why this is happening. Please help.
Here is the script. T(i) are trees (as in graphs).
The program operates great, until the step where
norm_ted is calculated. Mysteriously norm_ted becomes
0, even though "mag" value is ca