raw_input in python, 输出错误
raw_input in python, output wrong
我是python的大一新生,遇到了raw_input的问题。见下文
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 ***
--------------------
这是输出,我使用 raw_input 的代码是
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
区别在于 raw_input,你能解释一下发生了什么吗?
问题是测试脚本需要 Please guess a letter:
的特定输出,您的代码有 please give a guess letter:
如果您更改 raw_input
提示以匹配文本,测试将通过。
我是python的大一新生,遇到了raw_input的问题。见下文
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 ***
--------------------
这是输出,我使用 raw_input 的代码是
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
区别在于 raw_input,你能解释一下发生了什么吗?
问题是测试脚本需要 Please guess a letter:
的特定输出,您的代码有 please give a guess letter:
如果您更改 raw_input
提示以匹配文本,测试将通过。