Computer Science, asked by rahul7635, 11 months ago


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 deepaksaini9211
3

Answer:

(B) 'new' is printed

Explanation: right

Answered by facundoandres7
0

Answer:

Explanation:

(c) 'old' is printed

Similar questions