我正在尝试创建一个西班牙语琐事游戏,但我很难让随机问题接受答案作为该问题的答案。就像现在一样,代码最终只是简单地循环回到问题,直到完成所有三个猜测。任何帮助将不胜感激。
谢谢!
from random import randint
starting_line = 0
Comp_startingline = 0
finish_line = 100
guess_count = 0
limit_of_guesses = 3
player_1 = 0
player1 = randint(1,10)
computer = randint(1,10)
questions = randint(1,10)
# The questions that will come up in racing
if questions == 1:
questions = ("Hola, como estas, Carlos?")
answer = "Hello, how are you, Carlos?"
if questions == answer:
print ("You are correct!")
elif questions == 2:
questions = ("Me llamo, Mateo!")
answer1 = "My name is Matthew!"
if questions == answer1:
print ("You are correct!")
elif questions == 3:
questions = ("Que rabia!")
answer2 = "What rage!"
if questions == answer2:
print ("You are correct!")
elif questions == 4:
questions = ("Amigo!")
answer3 = "Friend!"
if questions == answer3:
print ("You are correct!")
elif questions == 5:
questions = ("Me nombre es.")
answer4 = "My name is."
if questions == answer4:
print ("You are correct!")
elif questions == 6:
questions = ("Le gusta?")
answer5 = "Do you like him?"
if questions == answer5:
print ("You are correct!")
elif questions == 7:
questions = ("Soy escritor")
answer6 = "I am a writer."
if questions == answer6:
print ("You are correct!")
elif questions == 8:
questions = ("Me gusta musica!")
answer7 = "I like music!"
if questions == answer7:
print ("You are correct!")
elif questions == 9:
questions = ("Que estado?")
answer8 = "What state?"
if questions == answer8:
print ("You are correct!")
else:
questions = ("De donde eres?")
answer9 = "Where are you from?"
if questions == answer9:
print ("You are correct!")
我在这里做错了什么?
紫衣仙女
慕少森
肥皂起泡泡
相关分类