I am new to Python and am currently trying to make Rock, Paper, Scissors to learn the language better. I, however, am having issues when asking the user for a choice. Here is the function that is acting up.
global userAnswerINTEGER
global userAnswer
global rock
global paper
global scissors
userAnswer = input("Rock, Paper, or Scissors? ")
print(userAnswer)
userAnswer = 0
if userAnswer == (rock):
userAnswerINTEGER = 1
results()
if userAnswer == (paper):
userAnswerINTEGER = 2
results()
if userAnswer == (scissors):
userAnswerINTEGER = 3
results()
if userAnswer != rock or paper or scissors:
print('Please, pick a valid answer choice.')
askUser()```
I have additional variables within the file.
rock = "Rock"
paper = "Paper"
scissors = "Scissors"
userAnswer = 0
However, no matter what I put in the prompt, it will always print 'Please, pick a valid answer choice.' How do I fix this?
Aucun commentaire:
Enregistrer un commentaire