Skip to content

Instantly share code, notes, and snippets.

@timeowilliams
Created September 18, 2020 16:14
Show Gist options
  • Save timeowilliams/cd0777d3041eae51c5071ec208054455 to your computer and use it in GitHub Desktop.
Save timeowilliams/cd0777d3041eae51c5071ec208054455 to your computer and use it in GitHub Desktop.
Practice Python 8: Rock paper scissors
play = input('Would you like to play rock paper scissors?')
while play == "yes":
user1 = input('Please enter your position(rock, paper,or scissors): ')
user2 = input('Please enter your position(rock, paper,or scissors): ')
#while user1 and user2 != "rock" or "paper" or "scissors":
#user1 = input('Please enter your position(rock, paper,or scissors): ')
#user2 = input('Please enter your position(rock, paper,or scissors): ')
if user1 == "rock" and user2 =="scissors":
print("rock wins")
play = "no"
elif user1 == "scissors" and user2 == "rock":
print("rock wins")
play = "no"
elif user1 == "rock" and user2 == "paper":
print("paper wins")
play = "no"
elif user1 == "paper" and user2 == "rock":
print("paper wins")
play = "no"
elif user1 == "paper" and user2 == "scissors":
print("scissors wins")
play = "no"
elif user1 == "scissors" and user2 == "paper":
print("scissors wins")
play = "no"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment