在这段代码中,我试图将变量self.damage
除以 20:
self.damage = map(lambda x: x/20, self.damage)
...
...
print("\nPICKAPOO's DAMAGE RATING WAS DECREASED BY 20%")
print("PICKAPOO's DAMAGE RATING IS NOW {}".format(str(self.damage)))
...
return self.damage
当我运行它时,我得到了这个奇怪的错误:
PICKAPOO's DAMAGE RATING WAS DECREASED BY 20%
PICKAPOO's DAMAGE RATING IS NOW <map object at 0x0000000002CB1128>
如果我尝试任何其他代码而不是我所拥有的代码,它会返回相同的TypeError: unsupported operand type(s)
错误。
对未来的任何想法、意见和建议将不胜感激。