2017-10-18 11 views
0

移動する前にユーザーが何かを入力するようにするには、何を追加する必要がありますか?何も入力されていないとき

ループで再度入力するためのプロンプト
print() 
print("Question 2") 
print("What is the currency of Spain?") 
print() 
print("A Euro") 
print("B Dollar") 
print("C Yen") 
print("D Krona") 
answer = input("What is your choice: ").upper() 

while answer is none #keep asking 
if answer == "A": 
     print("Correct!") 
     score = score + 1 
else: 
     print("Sorry, the correct answer was A") 
+1

'答え= '' ながら答え== '':回答=入力( "何とか")は、上部()' – depperm

答えて

-1

print() 
print("Question 2") 
print("What is the currency of Spain?") 
print() 
print("A Euro") 
print("B Dollar") 
print("C Yen") 
print("D Krona") 

answer = input("What is your choice: ").upper() 

while answer == "": 
    answer = input("What is your choice: ").upper() 
if answer == "A": 
     print("Correct!") 
     score = score + 1 
     correct = True 
else: 
     print("Sorry, the correct answer was A") 
関連する問題