diff --git a/Python-programs/stone_paper_scissor.py b/Python-programs/stone_paper_scissor.py new file mode 100644 index 00000000..79773426 --- /dev/null +++ b/Python-programs/stone_paper_scissor.py @@ -0,0 +1,37 @@ +import random +choices = ["Rock", "Paper", "Scissors"] +computer = random.choice(choices) +player = False +cpu_score = 0 +player_score = 0 +while True: + player = input("Rock, Paper or Scissors?").capitalize() + ## Conditions of Rock,Paper and Scissors + if player == computer: + print("Tie!") + elif player == "Rock": + if computer == "Paper": + print("You lose!", computer, "covers", player) + cpu_score+=1 + else: + print("You win!", player, "smashes", computer) + player_score+=1 + elif player == "Paper": + if computer == "Scissors": + print("You lose!", computer, "cut", player) + cpu_score+=1 + else: + print("You win!", player, "covers", computer) + player_score+=1 + elif player == "Scissors": + if computer == "Rock": + print("You lose...", computer, "smashes", player) + cpu_score+=1 + else: + print("You win!", player, "cut", computer) + player_score+=1 + elif player=='End': + print("Final Scores:") + print(f"CPU:{cpu_score}") + print(f"Plaer:{player_score}") + break