【发布时间】:2017-01-24 04:22:14
【问题描述】:
predictions = getPredictions(summaries, testSet)
accuracy = getAccuracy(testSet, predictions)
print('Accuracy: {0}%').format(accuracy)
以上代码有错误:
print('Accuracy: {0}%').format(accuracy)
AttributeError: 'NoneType' object has no attribute 'format'
【问题讨论】:
-
print('Accuracy: {0}%'.format(accuracy)) -
在提交新问题之前,请先查看重复项或使用 google。在此处发布问题时,SO 会列出可能的重复项;它甚至不允许您在没有
in python3.4的情况下发布问题,因为该标题已经存在。
标签: python