标签: python
假设我有一个包含100个变量的类,每个变量都有值。如何在不知道变量名称的情况下获取每个值。例如:
class Stuff(): a = 1 b = 2 c = 3 d = 9.36 e = "f" #and so on... for i in dir(Stuff): print(Stuff.i) #Does not work but it's what I want to achieve