import random
def pythonrubyjava():
gamelist = ["python" , "ruby", "java"]
userinput = raw_input("python, ruby, or java?:")
randominput = random.choice(gamelist)
print randominput
if userinput not in gamelist:
print "The game is over"
elif userinput == randominput:
print "correct"
elif userinput == "python" and randominput == "ruby":
print "WINNER!"
elif userinput == "ruby" and randominput == "java":
print "WINNER!"
elif userinput == "java" and randominput == "python":
print "WINNER!"
elif userinput == "python" and randominput == "java":
print "loser..."
elif userinput == "ruby" and randominput == "python":
print "loser..."
elif userinput == "java" and randominput == "ruby":
print "loser..."
Это то, что у меня есть до сих пор, но оно либо говорит, что выполняет команду, либо никогда не заканчивается или не возвращает правильную вещь.Я не понимаю, почему так долго возвращаться и никогда не бывает
Он ни выполняет ничего и не возвращает. Как вы выполняете этот скрипт? – Brian
«это либо говорит исполняющая команда» ... что это такое? – kindall
Вы на самом деле называли pythonrubyjava()? – Lugubrious