小编Aid*_*her的帖子

如何隐藏玩家的输入

我需要第二个用户看不到第一个用户的输入,但是当它告诉第二个用户输入时,第一个用户的输入就在他们前面

score=[0,0]
print("Welcome to Rock Paper Scissors! The score starts as",score)
while True:
    player1=input("Player 1's turn: ")
    player2=input("Player 2's turn: ")
    if (player1.lower() in ["rock","r","rick","rok","roc","rck"]):
        if (player2.lower() in ["scissors","s","scissor"]):
            score[0]=score[0]+1
            print("Player 1 wins! The score is now",score)
        if (player2.lower() in ["rock","r","rick","rok","roc","rck"]):
            print("It's a tie! The score remains",score)
        if (player2.lower() in ["paper","p","pap","piper"]):
            score[1]=score[1]+1
            print("Player 2 wins! The score is now",score)
    if (player1.lower() in ["scissors","s","scissor"]):
        if (player2.lower() in ["scissors","s","scissor"]):
            score[0]=score[0]+0
            print("It's a tie! The score remains",score)
        if (player2.lower() in ["rock","r","rick","rok","roc","rck"]):
            score[1]=score[1]+1
            print("Player …
Run Code Online (Sandbox Code Playgroud)

python python-3.x python-3.6

5
推荐指数
1
解决办法
2万
查看次数

标签 统计

python ×1

python-3.6 ×1

python-3.x ×1