del
` keyword followed by the object name and the property you want to delete. Here is an example :class Person:
def __init__(self, name, age):
self.name = name
self.age = age
person = Person("John", 28)
print(person.name) # Output: John
del person.name
print(person.name) # Raises an AttributeError: 'Person' object has no attribute 'name'
Person
` class with a constructor that initializes the `name
` and `age
` properties. We then create an instance of the `Person
` class called `person
` with a name of "John
" and an age of 28
.name
` property, which is "John
". Next, we use the `del
` keyword to delete the `name
` property from the `person
` object. name
` property again, but this time we get an `AttributeError
` because the `name
` property no longer exists.