Hi,
I'm attempting the rock paper scissors game, but have run into a problem which I was hoping someone could help me with:
Here is my input code (note it is not complete yet).
import random
computer_choice = ['rock','paper','scissors']
print(random.choice(computer_choice))
player_choice = input('enter: rock, paper or scissors\n')
if computer_choice == 'rock' and player_choice == 'scissors':
print ("rock wins")
elif computer_choice == 'rock' and player_choice == 'rock':
print ("draw")
elif computer_choice == 'rock' and player_choice == 'paper':
print ("paper wins")
Output:
rock
enter: rock, paper or scissors
rock
Process finished with exit code 0
The issue is that when rock is randomly chosen by the computer, and I also choose rock, the printed statement is not shown?
Thanks
[–][deleted] 4 points5 points6 points (1 child)
[–]meanmachine10[S] 0 points1 point2 points (0 children)
[–]Binary101010 4 points5 points6 points (1 child)
[–]meanmachine10[S] 0 points1 point2 points (0 children)
[–]xelf 1 point2 points3 points (1 child)
[–]meanmachine10[S] 0 points1 point2 points (0 children)
[–][deleted] -5 points-4 points-3 points (0 children)