python 23 days
反射、内置方法、repr和str、mmm
反射:
class A: Name1 = 'alex' Name2 = 'egon' Name3 = 'guangtou' inp = input('>>>') print(getattr(A,inp))
>>>Name1
alex
python 23 days
反射、内置方法、repr和str、mmm
反射:
class A: Name1 = 'alex' Name2 = 'egon' Name3 = 'guangtou' inp = input('>>>') print(getattr(A,inp))
>>>Name1
alex