1.

What is setattr() used for?(a) To access the attribute of the object(b) To set an attribute(c) To check if an attribute exists or not(d) To delete an attribute

Answer» The correct option is (b) To set an attribute

For explanation: setattr(obj,name,value) is used to set an attribute. If attribute doesn’t exist, then it would be created.


Discussion

No Comment Found