0
Class attributes
How to get access to all attributes of a class ? for example print all of attributes
5 Answers
+ 5
if we wanted to get and print the attributes and values of the object / instance and not of the class as in the sample that Slick provided, we can use:
...
print(a.__dict__)
put this line outside the class.
+ 4
A class is a user-defined blueprint or prototype from which objects are created.
class Service(object):
data = []
def __init__(self, other_data):
self.other_data = other_data
...
0
@Slick
what about the situation we want to print them with their values?
0
@vaibhav singh
I can't understand yout answer?