[Tutor] (no subject)
Jacob S.
keridee at jayco.net
Fri Jun 22 19:34:06 CEST 2007
Here the same thing
> def rock(self):
> value = "rock"
> computer_guess == random.choice(["scissors", "paper", "rock"])
> def scissors(self):
> value = "scissors"
> computer_guess == random.choice(["scissors", "paper", "rock"])
> def paper(self):
> value = "paper"
> computer_guess == random.choice(["scissors", "paper", "rock"])
In all three functions you have the line
computer_guess == random.choice(["scissors", "paper", "rock"])
This line compares the (undefined) variable "computer_guess" against the
result of the function call to random.choice. Even if computer_guess was
defined, it would still discard the result of the comparison. Surely you
mean to use only *one* equals sign.
More information about the Tutor
mailing list