How do I get an attribute from an object if I have the attribute name in a string?

前端 未结 2 1727
我在风中等你
我在风中等你 2020-12-12 06:01
 class a :
     b = 10

I have a class \'a\' with attribute \'b\'.

  o = a()

I create a object \'o\' of class \'a\

2条回答
提交回复
热议问题