📜  TypeError:最多输入 1 个参数,得到 3 个 - 无论代码示例

📅  最后修改于: 2022-03-11 14:58:33.590000             🧑  作者: Mango

代码示例1
#Problematic code:   answer = input("Is it", guess, "?")

#input only accepts one argument, you are passing it 3. You need to use string 
#formatting or concatenation to make it one argument:

answer = input("Is it {} ?".format(guess))

#You were confusing this with the print() function, which does indeed take more 
#than one argument and will concatenate the values into one string for you.