Re: [Tutor] changing name value with function return

2012-10-30 Thread Steven D'Aprano
On 31/10/12 03:56, richard kappler wrote: If I have a variable and send it's value to a function to be modified and returned, how do I get the function return to replace the original value of the variable? spam = function(spam) passes the value of "spam" to the function, then assigns the res

Re: [Tutor] changing name value with function return

2012-10-30 Thread Dave Angel
On 10/30/2012 12:56 PM, richard kappler wrote: > If I have a variable and send it's value to a function to be modified and > returned, how do I get the function return to replace the original value of > the variable? > > Example: > > import random > > x = 50 > > def rndDelta(x): > d = random.un

Re: [Tutor] changing name value with function return

2012-10-30 Thread Timo
Op 30-10-12 17:56, richard kappler schreef: If I have a variable and send it's value to a function to be modified and returned, how do I get the function return to replace the original value of the variable? Example: import random x = 50 def rndDelta(x): d = random.uniform(-10, 10)

[Tutor] changing name value with function return

2012-10-30 Thread richard kappler
If I have a variable and send it's value to a function to be modified and returned, how do I get the function return to replace the original value of the variable? Example: import random x = 50 def rndDelta(x): d = random.uniform(-10, 10) x = x + d return x When I call rndDelta, it