"Steve" <Gronicus@SGA.Ninja> writes:

> OK, I wrote:
>
> x = "A"
> print("x = " + x)
>
> def f(y):
>     print("x= " + x + "  y= "+ y)
>     
> f(x)
>
> and it worked, inspite of what I was seeing in my own program.  
> How quick I am to blame Python. (:
> When I isolate my function that stumped me, I will post it.

This small variation might point the way.  If you can explain it, you'll
be most of the way there.

x = "A"
print("x = " + x)

def f(y):
    x = "B"
    print("In f, x = " + x + "  y = "+ y)

f(x)
print("x = " + x)

<cut>

The material I cut did include the explanation so go back and read the
message you replied to here if you don't follow.

-- 
Ben.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to