i have to write a rock paper scissors program in python, but every time i run my code...
def rockPaperScissors():
import random
computerIndex = random.randint(1,3)
if computerIndex == 1:
computer = "rock"
elif computerIndex == 2:
computer = "scissors"
else:
computer = "paper"
player = raw_input("rock, paper or scissors :")
if player[0] != "r" or player[0] != "p" or player[0] != "s":
print "incorrect choice entered"
elif computer == "rock" and player == "rock":
print "its a draw"
elif computer == "rock" and player == "paper":
print "player wins"
elif computer == "rock" and player == "scissors":
print "computer wins"
elif computer == "scissors" and player == "rock":
print "player wins"
elif computer == "scissors" and player == "paper":
print "computer wins"
elif computer == "scissors" and player == "scissors":
print "its a draw"
elif computer == "paper" and player == "rock":
print "computer wins"
elif computer == "paper" and player == "paper":
print "its a draw"
elif computer == "paper" and player == "scissors":
print "player wins"
i get an error. not an actual error, its just that everytime i try to input my choice, the incorrect choice entered line comes up. im at a loss. im sure ive made some silly mistake somewhere, but can anyone spot it, because ive been staring at it for an hour now and i cant :(