Python Forum

Full Version: rock,paper,scissors
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
well in my lesson the AI only does 1 input thats wrong: Spaceshuttle
that i handled with this code:


elif player == ("Spaceshuttle"):

           print("Incorrect selection.")
i couldnt figure out how to do it for all wrong inputs xD
Use an 'else' clause:

player = "some-response"
if "rock" == player:
    # do things
elif "paper" == player:
    # do things
elif "scissors" == player:
    # do things
else:
    print("not a valid response")
Pages: 1 2