Delete the "age" property from the "person" object:
class Person:
name = "John"
age = 36
country = "Norway"
delattr(Person, 'age')
The delattr()
function will delete the specified attribute from the specified object.
delattr(object, attribute)
Parameter Values Parameter Description object Required. An object. attribute Required. The name of the attribute you want to remove Related PagesThe getattr() function, to get the value of an attribute
The hasattr() function, to check if an attribute exist
The setattr() function, to set the value of an attribute
Track your progress - it's free!
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4