Notifications
Clear all
Topic starter
Is it possible to safely check if a class/object has a certain attribute?
- A . yes, by using the hasattr attribute
B. yes, by using the hasattr ( ) method
C. yes, by using the hassattr ( ) function
D. no, it is not possible
Suggested Answer: C
Explanation:
Reference: https://stackoverflow.com/questions/610883/how-to-know-if-an-object-has-an-attribute-in-python
Explanation:
Reference: https://stackoverflow.com/questions/610883/how-to-know-if-an-object-has-an-attribute-in-python
Posted : 12/11/2022 5:58 am