Home / MCQ Bank / Computer
Computer Classes And Objects In Python

What will be the output of the following Python code? class test: def __init__(self): self.variable = 'Old' self.Change(self.variable) def Change(self, var): var = 'New' obj=test() print(obj.variable)

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option C • 'Old' is printed

Related Computer Questions

Why we need to a binary tree which is height balanced? Which of the following queries modifies fields not records? What is the purpose of the function eval? MapReduce jobs submitted from either Oozie, Pig or Hive can be used to encode, improve and sample the data sets from ______ into R. An oval represents which of the following in an EER?