📜  打印类python代码示例

📅  最后修改于: 2022-03-11 14:45:15.646000             🧑  作者: Mango

代码示例4
# to print out the variable names
print(vars(YourClass))

# to print out names and values
for var in vars(YourClass):
    print(getattr(YourClass, var))