The strings may have any casing. Rock, ROCK, roCK are all possible and valid. Anyone can help on how to allow my code to accept any case like rOcK and all... ?
player1 = input('Enter rock/paper/scissors: ')
player2 = input('Enter rock/paper/scissors: ')
if (player1 == player2):
print("The game is a Tie")
elif (player1 == 'rock' and player2 == 'scissors'):
print("player 1 wins")
elif (player1 == 'rock' and player2 == 'paper'):
print("player 2 wins")
elif (player1 == 'paper' and player2 == 'rock'):
print("player 1 wins")
elif (player1 == 'paper' and player2 == 'scissors'):
print("player 2 wins")
elif (player1 == 'scissors' and player2 == 'paper'):
print("player 1 wins")
elif (player1 == 'scissors' and player2 == 'rock'):
print("player 2 wins")
else:
print("Invalid input")
My code is perfectly running just can't figure out how to code to allow it accept any case.