Rock, Paper, Scissors Game In Python!🐍

Поделиться
HTML-код
  • Опубликовано: 18 ноя 2024

Комментарии • 3

  • @YousefCompSci
    @YousefCompSci  Месяц назад +1

    # 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!")

  • @nispatel89
    @nispatel89 Месяц назад +1

    Thanks for tutorial!

  • @Monsta1291
    @Monsta1291 Месяц назад +1