anonymous
  • anonymous
I am trying to make my rps game less case-sensitive, if that makes sense. Can i use the keyword "or" to assign multiple values to a variable? For example: Choice1="rock" or "Rock" or "ROCK" Choice2="paper" or "Paper" or "PAPER" Choice3="scissors" or "Scissors" or "SCISSORS" if player1==Choice1 and player2==Choice1: print "Tie" This example ran fine when I used raw_input. However, when I use parameters it will not function as expected (it only works if I use an all lowercase example). Isn't using 'or' in this way analogous to giving alternate conditions to the if statement? Am I using the wrong keyword? thank you so much!
Functions
chestercat
  • chestercat
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get this expert

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this
and thousands of other questions

rsmith6559
  • rsmith6559
or is a comparison operator. if( this or that): do something. The string library has functions like to_upper() and to_lower() which is what you probably want.
P0sitr0n
  • P0sitr0n
just convert all input to lower case
P0sitr0n
  • P0sitr0n
in java its typically string.toLowerCase()

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

anonymous
  • anonymous
You didn't say that what language that you are working in but the safe bet is just to convert to all lowercase.
P0sitr0n
  • P0sitr0n
btw or is usually || . and is usually &&
anonymous
  • anonymous
Thank you all so much!

Looking for something else?

Not the answer you are looking for? Search for more explanations.