Lesson 9: Rock-Paper-Scissors

posted Dec 14, 2017, 8:05 AM by Attila Lengyel
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!!!")
 
Comments