我在我的Python代码中出现错误
现在我正在使用libraty Turtle在Python中做一个简单的视频游戏,但是出现了这个错误,我不知道如何解决它。我在我的Python代码中出现错误
我的代码是在这里:
pastebin.com/wu5jM0gT
错误:
Traceback (most recent call last): File "C:/Users/ricar/PycharmProjects/Juego/Juego.py", line 122, in <module>
objetivo.movimiento()
File "C:/Users/ricar/PycharmProjects/Juego/Juego.py", line 91, in movimiento
self.forward(self.speed)
File "C:\Python27\lib\lib-tk\turtle.py", line 1553, in forward
self._go(distance)
File "C:\Python27\lib\lib-tk\turtle.py", line 1520, in _go
ende = self._position + self._orient * distance
File "C:\Python27\lib\lib-tk\turtle.py", line 277, in __mul__
return Vec2D(self[0]*other, self[1]*other)
TypeError: unsupported operand type(s) for *: 'float' and 'instancemethod'`
有什么建议?
回答:
你忘了括号
self.forward(self.speed())
以上是 我在我的Python代码中出现错误 的全部内容, 来源链接: utcz.com/qa/259364.html