Question: Consider a Python class defined as follows, where _ _ status is defined as a private instance attribute. Which of the following statements is /
Consider a Python class defined as follows, where status is defined as a private instance attribute. Which of the following statements isare correct about this class definition? Please note that there might be more than one correct statement, and you must choose all correct statements to receive full credit for this question.
class House:
numhouses
housetype SFMF
def initself sqft price, status:
self.area sqft
self.price price
self.status status
House.numhouses
@property
def statusself:
return self.status
@status.setter
def statusself val:
if val in House.housetype:
selfstatus val
else:
raise ValueErrorThe status of the house can only be SF or MF
house HouseSF
house HouseMF
House.numhouses
housenumhouses
househousetype F
housestatus MF
houseHousestatus MF
housestatus MF
Group of answer choices
The expression "houseHousestatus MF will update the value of the private attribute status for object house
The expression "househousetype F will update the value of the class attribute "housetype" for all objects of this class, including house
The expression "House.numhouses will increment the value of the class attribute "numhouses" for all objects of this class, including house
The expression "housestatus MF will update the value of the private attribute status for object house
The property called status is a readonly property.
The expression "housenumhouses will increment the value of the class attribute "numhouses" for all objects of this class, including house
The expression "housestatus MF will update the value of the private attribute status for object house
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
