Answers for "python get all variables in class"

1

python get all variables in class

vars = [attr for attr in dir(dino) if not callable(getattr(dino, attr)) and not attr.startswith("__")]
         
for v in vars:
	print("{0} = {1}".format(v,getattr(dino, v)))
Posted by: Guest on September-18-2021

Code answers related to "python get all variables in class"

Python Answers by Framework

Browse Popular Code Answers by Language