English

Give the statement to check whether the attribute str exists in the class Test whose object is T1.

Advertisements
Advertisements

Question

Give the statement to check whether the attribute str exists in the class Test whose object is T1.

Very Short Answer
Advertisements

Solution

hasattr(T1, "str")
shaalaa.com
  Is there an error in this question or solution?
Chapter 3: Classes in Python - EXERCISE [Page 63]

APPEARS IN

CBSE Computer Science with Python [English] Class 12
Chapter 3 Classes in Python
EXERCISE | Q 16. a. | Page 63
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×