Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from random import randint
- #create a list of options for players
- o = ["rock", "paper", "scissors"]
- #assign a random choice of option for the computer to play
- c = o[randint(0,2)]
- #set player to False
- player = False
- #create loop to play the game
- while player == False:
- player = input("Please type in your play: rock, paper, scissors? ")
- if player == c:
- print("<><><><> We have a tie! <><><><>")
- elif player == "rock":
- if c == "paper":
- print("xxxxx Loss -", c, "covers your", player, "xxxxx")
- else:
- print("!!!!!! Your the winner!", player, "crushes the", c, "!!!!!!")
- elif player == "paper":
- if c == "scissors":
- print("xxxxx Loss -", c, "cuts your", player, "xxxxx")
- else:
- print("!!!!!! Your the winner!", player, "covers the", c, "!!!!!!")
- elif player == "scissors":
- if c == "rock":
- print("xxxxx Loss -", c, "crushes your", player, "xxxxx")
- else:
- print("!!!!!! Your the winner!", player, "cuts the", c, "!!!!!!")
- else:
- print("Please enter a valid choice to play!")
- #player is set to True, but must be set to False to continue the loop
- player = False
- c = o[randint(0,2)]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement