2024-09-19 23:39:34 发布
网友
userName = input("What is your name?") firstInteger = (input ("Hi," , userName , "what is the first integer?"))
就这样回来了 TypeError:输入最多需要1个参数,得到3个
我试着将用户名改为str(input(…)),将firstInteger输入中的用户名改为str(userName),但都没有工作或更改错误消息。你知道吗
以下是基于注释的更新代码。你知道吗
我也不确定您使用的是什么版本的python,但是旧版本可能需要raw_input而不是input。如果您使用的是python3.x,那么只要input就可以了。这是最新的代码。如果您使用的是python3,只需将raw_input替换为input。你知道吗
raw_input
input
userName = raw_input("What is your name?") firstInteger = (raw_input ("Hi," + userName + " what is the first integer?"))
以下是基于注释的更新代码。你知道吗
我也不确定您使用的是什么版本的python,但是旧版本可能需要
raw_input
而不是input
。如果您使用的是python3.x,那么只要input
就可以了。这是最新的代码。如果您使用的是python3,只需将raw_input
替换为input
。你知道吗相关问题 更多 >
编程相关推荐