[Tutor] Global variables

John Fouhy john at fouhy.net
Tue Aug 15 01:50:47 CEST 2006


On 15/08/06, Kermit Rose <kermit at polaris.net> wrote:
> My routine strongfac calculates a value for fac in the subroutine, and the
> calling routine picks up a different vaalue.
>
> An illustration.
>
> In strong fac:
>
> fac = [1,2,3]
> print fac
> return fac
>
> in fermat:
>
> fac = strongfac(z)
> print fac
>
> prints [0,0,0]
>
> And most of the time it does not misbehave like this.

Can you post actual code to illustrate the problem?  Don't post your
entire module; just show us the functions involved, the input that
causes the problem, and what output you expect to get.

-- 
John.


More information about the Tutor mailing list