Python 输入最多需要1个参数,得到2个
它给了我一个Python 输入最多需要1个参数,得到2个,python,Python,它给了我一个输入错误,最多需要1个参数,得到2个,我不知道如何解决它。通过侦听错误消息,只将一个参数传递给输入(): 或使用字符串格式: Jamil = input(str(C1) + " Enter your strength:") 只有print()函数支持可变数量的参数。input()只接受一个参数 请参阅此帮助(交互式解释器): help()builtin是在Python中查找内容的便捷工具。 您可以在几乎任何内容上键入:help(…)以获得帮助(如果可用)。您向input()函数传递
输入错误,最多需要1个参数,得到2个,我不知道如何解决它。通过侦听错误消息,只将一个参数传递给输入()
:
或使用字符串格式:
Jamil = input(str(C1) + " Enter your strength:")
只有print()
函数支持可变数量的参数。input()
只接受一个参数
请参阅此帮助(交互式解释器):
help()
builtin是在Python中查找内容的便捷工具。
您可以在几乎任何内容上键入:help(…)
以获得帮助(如果可用)。您向input()函数传递了两个参数,它只需要一个参数
Jamil = input(str(C1) + " Enter your strength:")
Jamil = input("{} Enter your strength:".format(C1))
>>> help(input)
Help on built-in function input in module builtins:
input(...)
input([prompt]) -> string
Read a string from standard input. The trailing newline is stripped.
If the user hits EOF (Unix: Ctl-D, Windows: Ctl-Z+Return), raise EOFError.
On Unix, GNU readline is used if enabled. The prompt string, if given,
is printed without a trailing newline before reading.