读取用户输入会导致“TypeError:int()最多接受2个参数(给定3个)”

2024-06-02 08:48:05 发布

您现在位置:Python中文网/ 问答频道 /正文

每回合赢3个筹码。当玩家被要求选择一个数量的筹码时,我得到一个错误信息:

Traceback (most recent call last):
  File "F:\DOwnloads\okay (1).py", line 56, in <module>
    temp = input(int ("there are", chips,"chips. how many chips does player one want to take"))
TypeError: int() takes at most 2 arguments (3 given)

代码如下:

^{pr2}$

Tags: pymost数量downloadsline玩家callfile
1条回答
网友
1楼 · 发布于 2024-06-02 08:48:05

当您需要^{时,int(input("input string"))

更改此行:

temp = input(int ("there are", chips,"chips. how many chips does player one want to take"))

为此:

^{pr2}$

相关问题 更多 >