所以我有一些代码:
self.nextY = int(self.y + self.aY * 0,7071 - (9.98 * 0.1 * 0.1)/2)
以下是回溯:
Traceback (most recent call last):
File "C:\Users\CrazyDude\workspace\flappy-bird-bot\src\main.py", line 16, in <module>
bird.get_position(image)
File "C:\Users\CrazyDude\workspace\flappy-bird-bot\src\flappy.py", line 31, in get_position
self.nextY = int(self.y + self.aY * 0,7071 - (9.98 * 0.1 * 0.1)/2)
TypeError: integer argument expected, got float
如果我把变量改成int,它怎么可能期望int呢?你知道吗
代码将两个参数传递给
int
函数。(第二个参数被视为base
如果有两个参数,它应该是整数。)也许你是说
0.7071
而不是0,7071
?你知道吗相关问题 更多 >
编程相关推荐