anonymous
  • anonymous
Can anyone figure out where I am going wrong? player1 = raw_input ("Player 1 ?") player2 = raw_input ("Player 2 ?") if (player1 == 'rock' and player2 == 'scissors'): print "Player 1 wins." elif (player1 == 'rock' and player2 == 'rock'): print "Tie" elif (player1 == 'scissors' and player2 == 'paper'): print "Player 1 wins." elif (player2 == 'scissors' and player2 == 'scissors'): print "Tie" elif (player1 == 'paper' and player2 == 'paper'): print "Tie" elif (player1 == 'paper' and player2 == 'scissors'): print "Player 2 wins." elif (player1 == 'roc
Computer Science
jamiebookeater
  • jamiebookeater
See more answers at brainly.com
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get this expert

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this
and thousands of other questions

anonymous
  • anonymous
Sorry this is the actual code player1 = raw_input ("Player 1 ?") player2 = raw_input ("Player 2 ?") if (player1 == 'rock' and player2 == 'scissors'): print "Player 1 wins." elif (player1 == 'rock' and player2 == 'rock'): print "Tie" elif (player1 == 'scissors' and player2 == 'paper'): print "Player 1 wins." elif (player2 == 'scissors' and player2 == 'scissors'): print "Tie" elif (player1 == 'paper' and player2 == 'paper'): print "Tie" elif (player1 == 'paper' and player2 == 'scissors'): print "Player 2 wins." elif (player1 == 'rock'and player2 == 'paper'): print "Player 2 wins." elif (player1 == 'paper' and player2 == 'rock'): print "Player 2 wins." elif (player1 == 'scissors' and player2 == 'rock'): print "Player 2 wins." else: print "This is not a valid object selection."
anonymous
  • anonymous
What is happening?
anonymous
  • anonymous
When I run the code and type in an input for player1 and player2.....no matter what the answers are, it always go straight to the else statement and prints "This is not a valid object selection." Hope this info helps. Thanks for the assistance!

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

anonymous
  • anonymous
I ran it and it worked.
anonymous
  • anonymous
really?
anonymous
  • anonymous
maybe my complier is old?
anonymous
  • anonymous
try putting in 'rock' and 'rock' as inputs
anonymous
  • anonymous
typos while you input may cause that such as Paper and paper etc.
anonymous
  • anonymous
you should type paper exactly as in the logical comparison
anonymous
  • anonymous
add the lower function to your input ``` player1 = raw_input("Player 1? ").lower() player2 = raw_input("Player 2? ").lower() ``` this insures that your input is all lowercase since thats what you're using to test in your if statements. So if you entered Rock then it would change it to rock and then do comparisons on it.

Looking for something else?

Not the answer you are looking for? Search for more explanations.