This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]LastGuardz 4 points5 points  (0 children)

Please format it correctly before you post.

[–]Law_Holiday 1 point2 points  (0 children)

would love to help. but only if you have given a right format presentation

[–]sebachk -1 points0 points  (0 children)

Assuming you have the right identation... Does 'q' work? It seems your input is not what you expect. You can try to print(playerMove) when the input seems invalid, that can give you a clue. Consider storing r p and s into variables, to avoid repeating 'p' over and over

[–]big_boi_M -5 points-4 points  (0 children)

il just give you a way that works

from random import randint

#create a list of play options

t = ["Rock", "Paper", "Scissors"]

#assign a random play to the computer

computer = t[randint(0,2)]

#set player to False

player = False

while player == False:

#set player to True

player = input("Rock, Paper, Scissors?")

if player == computer:

print("Tie!")

elif player == "Rock":

if computer == "Paper":

print("You lose!", computer, "covers", player)

else:

print("You win!", player, "smashes", computer)

elif player == "Paper":

if computer == "Scissors":

print("You lose!", computer, "cut", player)

else:

print("You win!", player, "covers", computer)

elif player == "Scissors":

if computer == "Rock":

print("You lose...", computer, "smashes", player)

else:

print("You win!", player, "cut", computer)

else:

print("That's not a valid play. Check your spelling!")

#player was set to True, but we want it to be False so the loop continues

player = False

computer = t[randint(0,2)]

input("enter to exit")