Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

nkesw001 Group Title

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

  • 5 months ago
  • 5 months ago

  • This Question is Open
  1. nkesw001 Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    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."

    • 5 months ago
  2. wio Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    What is happening?

    • 5 months ago
  3. nkesw001 Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    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!

    • 5 months ago
  4. wio Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    I ran it and it worked.

    • 5 months ago
  5. nkesw001 Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    really?

    • 5 months ago
  6. nkesw001 Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    maybe my complier is old?

    • 5 months ago
  7. wio Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    try putting in 'rock' and 'rock' as inputs

    • 5 months ago
  8. happybee Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    typos while you input may cause that such as Paper and paper etc.

    • 5 months ago
  9. happybee Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    you should type paper exactly as in the logical comparison

    • 5 months ago
  10. Tyler1992 Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    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.

    • 4 months ago
    • Attachments:

See more questions >>>

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.