Answered step by step
Verified Expert Solution
Question
1 Approved Answer
QUESTION 29 What is the output of the following code? class Demo def _init_(self): self.a 1 self. b 5 def display (self): return self. b
QUESTION 29 What is the output of the following code? class Demo def _init_(self): self.a 1 self. b 5 def display (self): return self. b obj -Demo() print (obj.a) o a. The program has an error because there isn't any function to return self.a b. The program has an error because b is private and display(self) is returning a private member O .The program runs fine and 1 is printed o d. The program has an error as you can't name a class member using b QUESTION 30 Which of the following types of methods stores a value in a data attribute or changes its value in some other way? a. modifier constructor mutator accessor
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started