var()函数:把对象的属性和属性值组成字典
class Person:
def __init__(self,name,age,score) -> None:
self.name=name
self.age=age
self.score=score
x = vars(Person)
print(x)
p=Person("Lu Mingfei",19,100)
print(vars(p))
{'__module__': '__main__', '__init__': <function Person.__init__ at 0x0000022A4B789CA0>, '__dict__': <attribute '__dict__' of 'Person' objects>, '__weakref__': <attribute '__weakref__' of 'Person' objects>, '__doc__': None}
{'name': 'Lu Mingfei', 'age': 19, 'score': 100}