6.29一个_rcv 面试题
#coding:utf-8 #2018-6-29 16:30:34 #类调用属性,属性没有,用__getatrr__魔法方法! #目的打印出 think different itcast class Foo(object): """ """ def __init__(self): pass def __getattr__(self,item): print(item, end="") return self def __str__(self): return "" print(Foo().think.different.itcast)