delattr(), getattr(), setattr()

The setattr() assigns a value to an attributes of an object, getattr() returns the attribute of an object, delattr() deletes it.

 
setattr(car, "speed", 320)
# the same as: car.speed = 320
getattr( car, "speed")
# the same as: car.speed
delattr( car, "speed")
# the same as: del car.speed



Subsections