Ace school

with brainly

  • Get help from millions of students
  • Learn from experts with step-by-step explanations
  • Level-up by helping others

A community for students.

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
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
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

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."
What is happening?
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!

Not the answer you are looking for?

Search for more explanations.

Ask your own question

Other answers:

I ran it and it worked.
really?
maybe my complier is old?
try putting in 'rock' and 'rock' as inputs
typos while you input may cause that such as Paper and paper etc.
you should type paper exactly as in the logical comparison
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.

Not the answer you are looking for?

Search for more explanations.

Ask your own question