I'm pretty new to Python and an working on this homework assignment. I'm not sure how to assign the random.choice to a variable so I can proceed with a if-then statement.
import random
def whoWin(): if userInput == choices
def main():
userInput = input("rock, paper, or scissor?") print "You chose: " + userInput
choices = ["rock", "paper", "scissors"]
print "The computer chose: " + (random.choice(choices))
main()
Aucun commentaire:
Enregistrer un commentaire