What is the output of following code ?
class test:
def __init__(self):
self. variable = 'old'
self. change (self. variable)
def change (self, var):
var = 'new'
obj = test().
print(obj.variable)
(A) error:function cannot be called
(B) 'new' is printed
(c) 'old' is printed
(D) nothing is printed
Answers
Answered by
3
Answer:
(B) 'new' is printed
Explanation: right
Answered by
0
Answer:
Explanation:
(c) 'old' is printed
Similar questions