repl.it
@AzureScripts/

Rock Paper Scissors

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import random

print("Welcome to Rock Paper Scissors!")
print("What would you like to do?")
print("1. How to Play\n2. Play")
choice = input(">> ")

Rock_paper_scissors = ["Rock", "Paper", "Scissors"]

#how to play
if choice == "1":
    print("You must choose between Rock, Paper, or Scissors, and the computer will make it's choice. And depending on what you both get, one of you will win!")

# play

if choice == "2":
    plr_choice = input("Rock, Paper, or Scissors >> ").lower()
    print("Player: Chose", plr_choice)
    computer_choice = random.choice(Rock_paper_scissors)
    print("Computer: Chose", computer_choice)

    # WINNING CHOICE
    if plr_choice == "rock" and computer_choice == "Scissors":
        print("You win!")
    
    if plr_choice == "paper" and computer_choice == "Rock":
        print("You win!")

    if plr_choice == "scissors" and computer_choice == "Paper":
        print("You win!")

    # LOSING CHOICE 
    if plr_choice == "rock" and computer_choice == "Paper":
        print("You lost! :(")
    
    if plr_choice == "paper" and computer_choice == "Scissors":
        print("You lost! :(")

    if plr_choice == "scissors" and computer_choice == "Rock":
        print("You lost! :(")
    
    # DRAW
    if plr_choice == computer_choice:
        print("It's a draw")
?