2016-04-12 27 views
0

構文エラーが発生する。私は入れません ........ CODE:クイズが意図したとおりに動作しない

answer = "b" 
question = "1) Who made the game Grand Theft Auto 5??\nPlease choose from the following and write a letter: \n◘ A)Viral\n◘ B)Rockstar Games\n◘ C)Madfinger\n◘ D)Gameloft" 
print(question) 
guess=input().lower() 
name=input("Please enter your answer: ") 
if guess ==answer: 
    print("Correct") 
    score = score + 1 
    print("Score:") 
    print(score) 

else: 
    print("Wrong") 
+0

ここで何をしますか?あなたは私たちにいくつかの出力を見せますか? – Whitefret

+0

出力は「答えを入力してください」と表示されません。 –

+0

@Whitefretそれを表示するために、私はENTERを押す必要がありますが、私はしたくありません。私はちょうど何も押さずにそれを印刷したい:/ –

答えて

3

あなたが名前を使用することはありませんので、なぜそれを削除しませんか?

answer = "b" 
question = "1) Who made the game Grand Theft Auto 5??\nPlease choose from the following and write a letter: \n◘ A)Viral\n◘ B)Rockstar Games\n◘ C)Madfinger\n◘ D)Gameloft\n" 
print(question) 
guess=input("Please enter your answer: ").lower() 
if guess ==answer: 
    print("Correct") 
    score = score + 1 
    print("Score:") 
    print(score) 

else: 
    print("Wrong") 
関連する問題