Answers for "python send object reference to another function and edit property"

1

python send object reference to another function and edit property

class Test:
  a = 1

def f(obj):
  obj.a = 10

t = Test()
f(t)

# t.a should be 10
Posted by: Guest on January-18-2021

Code answers related to "python send object reference to another function and edit property"

Python Answers by Framework

Browse Popular Code Answers by Language