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
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
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)
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