# hi, please like and subscribe. It would mean a lot :D import random options = ("rock", "paper", "scissors") running = True while running: player = None computer = random.choice(options) while player not in options: player = input("Enter a proper choice pls (rock, paper, or scissors): ") print(f"Player: {player}") print(f"Computer: {computer}") if player == computer: print("It's a tie") elif player == "rock" and computer == "scissors": print("You win!") elif player == "paper" and computer == "rock": print("You win!") elif player == "scissors" and computer == "paper": print("You win!") else: print("You lose!") if not input("Do you want to play again? (y/n): ").lower() == "y": running = False print("Thanks for playing :D ") # if player == computer: # print("computer: ", computer) # print("player: ", player) # print("Tie") # elif player == "rock": # if computer == "paper": # print("computer: ", computer) # print("player: ", player) # print("You Lose!")
# hi, please like and subscribe. It would mean a lot :D
import random
options = ("rock", "paper", "scissors")
running = True
while running:
player = None
computer = random.choice(options)
while player not in options:
player = input("Enter a proper choice pls (rock, paper, or scissors): ")
print(f"Player: {player}")
print(f"Computer: {computer}")
if player == computer:
print("It's a tie")
elif player == "rock" and computer == "scissors":
print("You win!")
elif player == "paper" and computer == "rock":
print("You win!")
elif player == "scissors" and computer == "paper":
print("You win!")
else:
print("You lose!")
if not input("Do you want to play again? (y/n): ").lower() == "y":
running = False
print("Thanks for playing :D ")
# if player == computer:
# print("computer: ", computer)
# print("player: ", player)
# print("Tie")
# elif player == "rock":
# if computer == "paper":
# print("computer: ", computer)
# print("player: ", player)
# print("You Lose!")
Thanks for tutorial!