Sail E0 Webinar
Question
What is setattr() used for?
Options:
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: Option B


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



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers