Rapid_tv

🔹 Introduction

The current image has no alternative text. The file name is: IMG_20250930_022507_edit_386760261149282-scaled.jpg

The Rock, Paper, Scissors Game is a classic hand game that you can easily build in Python.

  • The player chooses Rock, Paper, or Scissors.
  • The computer randomly chooses one too.
  • The winner is decided based on the game rules.

👉 Rules:

  • Rock beats Scissors
  • Scissors beats Paper
  • Paper beats Rock

🔹 Code Example

import random

print("🎲 Welcome to Rock, Paper, Scissors Game!")

choices = ["rock", "paper", "scissors"]

while True:
    # Player choice
    player = input("👉 Enter rock, paper, or scissors (or 'q' to quit): ").lower()

    if player == "q":
        print("👋 Thanks for playing! Goodbye.")
        break

    if player not in choices:
        print("⚠️ Invalid choice. Please try again.")
        continue

    # Computer choice
    computer = random.choice(choices)
    print(f"💻 Computer chose: {computer}")

    # Decide winner
    if player == computer:
        print("🤝 It's a tie!")
    elif (player == "rock" and computer == "scissors") or \
         (player == "scissors" and computer == "paper") or \
         (player == "paper" and computer == "rock"):
        print("🎉 You win!")
    else:
        print("😢 You lose!")

🔹 Example Run

🎲 Welcome to Rock, Paper, Scissors Game!
👉 Enter rock, paper, or scissors (or 'q' to quit): rock
💻 Computer chose: scissors
🎉 You win!

👉 Enter rock, paper, or scissors (or 'q' to quit): paper
💻 Computer chose: scissors
😢 You lose!

👉 Enter rock, paper, or scissors (or 'q' to quit): q
👋 Thanks for playing! Goodbye.

🔹 Concepts Learned

  • random.choice() → lets the computer pick a random option.
  • while loop → allows continuous play until the player quits.
  • if/elif/else → determines the winner.
  • string methods (like .lower()) to handle user input better.

🔹 Summary
  • Built a Rock, Paper, Scissors game in Python.
  • Practiced loops, random choices, and conditionals.
  • Added option to quit (q).
⬇️ Download Rapid_tv تحميل Server 1 ⬇️ Download Rapid_tv تحميل Server 2

Related Posts

VOD-ZalHD

🔹 Introduction The Number Guessing Game is a classic beginner Python project. 🔹 Code Example 🔹 Example Run 🔹 Concepts Learned 🔹 Summary ⬇️ Download VOD-ZalHD تحميل Server 1 ⬇️…

Read more

Delux_pro

🔹 Introduction The To-Do List App is one of the most popular beginner projects. It teaches you how to: 🔹 Code Example 🔹 Features of This App 🔹 Example Run…

Read more

Fam4k

🔰 Project Overview A calculator is one of the simplest yet most effective projects to start with in Python.You will learn: ✍️ Step 1: Plan the Calculator We need: 🖥️…

Read more

Speed_HD+

1. Introduction Data visualization helps us understand patterns and insights in data by converting raw numbers into charts and graphs.In Python, the most popular libraries are: 2. Installing Required Libraries…

Read more

Dauo

1. Introduction Web scraping is the process of extracting data from websites. In Python, we commonly use libraries like requests (to fetch web pages) and BeautifulSoup (to parse and extract…

Read more

Macia_Pro

1. What is an API? 2. The requests Library The most common library for working with APIs in Python. Install if needed: 3. Making a GET Request ✅ GET requests…

Read more