Lesson 9: Rock-Paper-Scissors

Post date: Dec 14, 2017 4:05:02 PM

import time

import random

print("Let's play Rock-Paper-Scissors")

time.sleep(3)

print("Ready???")

time.sleep(1)

print("Rock")

time.sleep(1)

print("Paper")

time.sleep(1)

print("Scissor")

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

selection = random.randint(0,2)

print(choices[selection])

user = input("What is your choice?:")

if choices[selection] == user:

print("Draw")

elif (choices[selection] == "Rock" and user == "Paper") or (choices[selection] == "Scissor" and user == "Rock") or (choices[selection] == "Paper" and user == "Scissor"):

print ("You won!!!")

else:

print("You lost!!!")