Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to view all attributes and methods of an object python

class Person:
    def __init__(self,name,age):
        self.name = name
        self.age = age
    def printInfo(self):
        print("name: {}, age: {}".format(self.name,self.age))

p1 = Person('Tom',24)
# right below
print(p1.__dict__)
 
PREVIOUS NEXT
Tagged: #view #attributes #methods #object #python
ADD COMMENT
Topic
Name
9+2 =