Passing value or passing address : Function Parameters « Function « Python






Passing value or passing address

Passing value or passing address

def try_to_change(n):
         n = 'Changed'

name = 'Init'
try_to_change(name)

print name




           
       








Related examples in the same category

1.Four different ways to pass parametersFour different ways to pass parameters
2.Pass string value into a functionPass string value into a function
3.Python functions are 'typeless'Python functions are 'typeless'
4.Pass immutable and mutable value into functionPass immutable and mutable value into function