0
import random

rock = '''
    _______
---'   ____)
      (_____)
      (_____)
      (____)
---.__(___)
'''

paper = '''
    _______
---'   ____)____
          ______)
          _______)
         _______)
---.__________)
'''

scissors = '''
    _______
---'   ____)____
          ______)
       __________)
      (____)
---.__(___)
'''

print("Welcome to the federaton of the ultimate Rock, Paper, Scissors Championship. Today you'll be facing the ultimate opponent... The Computer\n")
print("Type 'R' for Rock, 'P' for Paper and 'S' for Scissors. \nWe'll call 'Rock, Paper, Scissors says.... and you will input your answer after Shoot!!!'\n")
print("Rock, Paper, Scissors says.... ")

RPS_selection = input("Shoot!!! ")
print (RPS_selection)

if RPS_selection == "R" or "r":
  print(rock)
if RPS_selection == "P" or "p":
  print(paper)
else:
  print(scissors)

Every time I run the following code, Rock seems to always print now matter what I put as the input. I'm confused because I am using an If statement with the "==" sign which would state that the input would have to be equivalent to what I'm comparing it to. I know this can be refracted down, but want an understanding of what I'm missing here. Any and all help is appreciated. Thanks!

pakpe
  • 5,391
  • 2
  • 8
  • 23

2 Answers2

1

Here it is. Fix your conditionals as follows:

if RPS_selection == "R" or RPS_selection == "r":
  print(rock)
elif RPS_selection == "P" or RPS_selection == "p":
  print(paper)
else:
  print(scissors)
pakpe
  • 5,391
  • 2
  • 8
  • 23
0
if RPS_selection == "R" or RPS_selection == "r":
  print(rock)
if RPS_selection == "P" or RPS_selection == "p":
  print(paper)
else:
  print(scissors)

This worked for me, you gotta specify the same condition for the lower case letter as well otherwise you are just saying "r" with no condition to it.