What is & How to use getattr() in Python?
Objects in Python can have attributes — data attributes and functions to work with those (methods). Actually, every object has built-in attributes (try dir(None), dir(True), dir(…), dir(dir) in Python console). For example you have an object person, that has several attributes: name, gender, etc. You access these attributes (be it methods or data objects) usually … Read more