Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Python%20Interview%20Questions%20and%20Answers

Question: How can I find the methods or attributes of an object?
Answer:

For an instance x of a user-defined class, dir(x) returns an alphabetized list of the names containing the instance attributes and methods and attributes defined by its class.

Is it helpful? Yes No

Most helpful rated by users:

©2024 WithoutBook