Answers for "python faq call by reference"

0

python faq call by reference

>>> def func1(a, b):
...     a = 'new-value'        # a and b are local names
...     b = b + 1              # assigned to new objects
...     return a, b            # return new values
...
>>> x, y = 'old-value', 99
>>> func1(x, y)
('new-value', 100)
Posted by: Guest on April-12-2022

Python Answers by Framework

Browse Popular Code Answers by Language