“中的14个错误”;“艰苦学习Python”;

“中的14个错误”;“艰苦学习Python”;,python,Python,所以我已经运行了好几次代码,我在书中逐字逐行地记录了代码,但仍有一个错误不断出现: Traceback (most recent call last): File "ex14.py", line 25, in <module> ''' (likes, computer, house) TypeError: 'str' object is not callable 任何帮助都将不胜感激 print ''' ALright, so you said %r about li

所以我已经运行了好几次代码,我在书中逐字逐行地记录了代码,但仍有一个错误不断出现:

Traceback (most recent call last):
  File "ex14.py", line 25, in <module>
    ''' (likes, computer, house)
TypeError: 'str' object is not callable
任何帮助都将不胜感激

 print ''' ALright, so you said %r about liking me. You live in %r. Not sure where that is. And you have a %r computer. Nice. ''' (likes, computer, house)
在这一行中(这就是问题所在),您缺少一个“%”,应该是这样的:

print ''' ALright, so you said %r about liking me. You live in %r. Not sure where that is. And you have a %r computer. Nice. ''' % (likes, computer, house)

请用适当的格式编辑您的问题,即显示什么是代码,什么不是-这使每个人都能更清楚地看到错误并回答您的问题。
print ''' ALright, so you said %r about liking me. You live in %r. Not sure where that is. And you have a %r computer. Nice. ''' % (likes, computer, house)