Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/300.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
python中的原始输入,输出错误_Python_Raw Input - Fatal编程技术网

python中的原始输入,输出错误

python中的原始输入,输出错误,python,raw-input,Python,Raw Input,我是python的大一新生,面临着原始输入的问题。见下文 Welcome to the game, Hangman! I am thinking of a word that is 1 letters long. ------------- you have 8 guesses left. Available letters: abcdefghijklmnopqrstuvwxyz please give a guess letter: c Good guess: c -------------

我是python的大一新生,面临着原始输入的问题。见下文

Welcome to the game, Hangman!
I am thinking of a word that is 1 letters long.
-------------
you have 8 guesses left.
Available letters: abcdefghijklmnopqrstuvwxyz
please give a guess letter: c
Good guess: c
-------------
Congratulations, you won!
None

*** ERROR: Failing test.
Expected line: Please guess a letter: c
Your code generated: please give a guess letter: c *** 

--------------------
这是输出,我使用原始输入的代码是

    guess = raw_input("please give a guess letter: ")
正确的输出是

Welcome to the game Hangman!
I am thinking of a word that is 1 letters long
-----------
You have 8 guesses left
Available Letters: abcdefghijklmnopqrstuvwxyz
Please guess a letter: c
Good guess: c
-----------
Congratulations, you won!
None

区别在于原始输入,您能解释一下发生了什么吗?

问题是测试脚本需要特定的输出,请猜一个字母:,您的代码有请猜一个字母:


如果更改原始输入提示以匹配文本,测试将通过。

这是我用Python3x制作的绞刑架。你可以检查一下。唯一的区别是使用输入而不是原始输入,因为它是Python3x。您没有显示失败的代码,但它似乎只是希望原始输入使用不同的参数猜测字母pro给出猜测字母,请使用正确的大小写,等等。