标签: class object
import math class Word: '''A class that represents word''' def __init__(self, word): self._word = word def __str__(self): return self._word c = word("Hello") print (c())
结果为“builtins.TypeError:'Word'对象不可调用”
如何使用print(c())检查c的值?