Run
class Fruit: name = '' quantity = '' description = '' def __init__(self, name, quantity, description): self.name = name self.quantity = quantity self.description = description def __str__(self): details = '' details += f'Name : {self.name}\n' details += f'Quantity : {self.quantity}\n' details += f'Description : {self.description}\n' return details apple = Fruit('Apple', '58', 'Good for health.') # Before delete attribute print(apple) delattr(apple, 'description') # After delete attribute print(apple)
Output