'str' object is not callable
class Book:
def __init__(self, price, color):
self.price = price
self.color2 = color # color发生冲突,导致出错
eng = Book( 100, 'red')
print('书的价格是:%d ' %eng.price)
eng.color2()
原因是color2是一个字符串,结果要调用color2()
不是函数,所以不能call,是not callable的