有没有办法我可以做一个石头-布-剪刀游戏,有大于和小于的符号?在
我知道做RPS有不同的方法,但我想具体了解一下“大于”和“小于”。在
这是我的代码:"Rock" > "Scissors" and 'Rock' < 'Paper'
"Paper" > "Rock" and 'Scissors' < 'Rock'
"Sissors" > "Paper" and 'Paper' < 'Scissors'
choose1 = input("Player One, Enter your answer ")
choose2 = input("Player Two, Enter your answer ")
if choose1 == "Paper":
"Paper" > "Rock"
if choose1 == "Scissor":
"Scissor" > "Rock"
if choose1 != "Rock" and choose1 != "Paper" and choose1 != "Scissors":
print("Player one please chose Rock, Paper, or Scissors")
if choose2 != "Rock" and choose2 != "Paper" and choose2 != "Scissors":
print("Player two please chose Rock, Paper, or Scissors")
if choose1 > choose2:
print('Player1 ({}) beats ({})'.format (choose1, choose2))
else:
print('Player2 ({}) beats ({})'.format (choose2, choose1))
这个游戏起作用了,然而,它认为石头打败了一切,纸打败了剪刀,剪刀却什么也没打。在
如何修复此代码以使其正确执行?在