I've been trying to make a rock paper scissors game in python and one of my major if statements isn't checking the if the input is equal to an object in a list. In addition, of my functions isn't checking if two responses are equal.
I've tried to change stuff to str and changing the opponents list but it was to no avail.
Any help would be appreciated.
import random
def Scoring():
if Player_Choice == Opponent_Choice:
print("It's a Tie")
print(f'Your Score: {Score}')
elif Player_Choice == "paper" and Opponent_Choice == "rock":
print('You Win')
score = score + 1
print(f'Your Score: {Score}')
elif Player_Choice == "rock" and Opponent_Choice == "paper":
print('You Lose')
print(f'Your Score: {Score}')
elif Player_Choice == "scissors" and Opponent_Choice == "rock":
print('You Lose')
print(f'Your Score: {Score}')
elif Player_Choice == "rock" and Opponent_Choice == "scissors":
print('You Win')
score = score + 1
print(f'Your Score: {Score}')
elif Player_Choice == "paper" and Opponent_Choice == "scissors":
print('You Lose')
print(f'Your Score: {Score}')
elif Player_Choice == "scissors" and Opponent_Choice == "paper":
print('You Win')
score = score + 1
# Variables
RPS_Choices = ['Rock', 'rock', 'Paper', 'paper', 'Scissors', 'scissors']
Opponent_Choices = ['rock', 'paper', 'scissors']
Player_Choice = None
Score = 0
# Code Shit
while True:
Player_Choice = str(input('Rock, Paper, or Scissors? ').lower())
while Player_Choice in RPS_Choices:
if Player_Choice == RPS_Choices[0] or RPS_Choices[1]: # Rock
Opponent_Choice = random.choices(Opponent_Choices, weights=[2, 5, 3])
print(f'''Computer Chose: {Opponent_Choice[0]} \nPlayer Chose: {Player_Choice.lower()}''')
Opponent_Choice = str(Opponent_Choice)
Scoring()
break
elif Player_Choice == RPS_Choices[2] or RPS_Choices[3]: # Paper
Opponent_Choice = random.choices(Opponent_Choices, weights=[3, 2, 5])
print(f'''Computer Chose: {Opponent_Choice[0]} \nPlayer Chose: {Player_Choice.lower()}''')
Opponent_Choice = str(Opponent_Choice)
Scoring()
break
elif Player_Choice == RPS_Choices[4] or RPS_Choices[5]: # Scissors
Opponent_Choice = random.choices(Opponent_Choices, weights=[5, 3, 2])
print(f'''Computer Chose: {Opponent_Choice[0]} \nPlayer Chose: {Player_Choice.lower()}''')
Opponent_Choice = str(Opponent_Choice)
Scoring()
break