Question: What is output? class Item: def _ _ init _ _ ( self ) : self.name = 'None' self.quantity = 0 def dsp _ item

What is output?
class Item:
def __init__(self):
self.name = 'None'
self.quantity =0
def dsp_item(self):
print(f'Name: {self.name}, Quantity: {self.quantity}')
class Produce(Item): # Derived from Item
def __init__(self):
Item.__init__(self) # Call base class constructor
self.expiration ='01-01-2000'
def dsp_item(self):
Item.dsp_item(self)
print(f'Expiration: {self.expiration}')
n = Produce()
n.dsp_item()
Question 10 options:
Name: None, Quantity: 0Expiration: 01-01-2000
Expiration: 01-01-2000
dsp_item() returns a AttributeError
Expiration: 01-01-2000Expiration: 01-01-2000

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!