Share your repls and programming experiences

← Back to all posts
rock paper scissors game
PreethiChander (1)

print("Rock Paper Scissors.")
print("Start by typing Rock, Paper, or Scissors")
answer= input()
list1= ["rock", "paper", "scissors"]
import random
rps= random.choice(list1)
if answer== 'rock' and rps== 'rock':
print("You tied with the computer")
print("computer: " + rps)
elif answer== 'rock' and rps== 'paper':
print("You lose 1 round")
print("computer: " + rps)
elif answer== 'rock' and rps== 'scissors':
print("You win 1 round")
print("computer: " + rps)
elif answer== 'paper' and rps== 'rock':
print("You win 1 round")
print("computer: " + rps)
elif answer== 'paper' and rps== 'paper':
print("You Tied with the computer")
print("computer: " + rps)
elif answer== 'paper' and rps== 'scissors':
print("You lost 1 round")
print("computer: " + rps)
elif answer== 'scissors' and rps== 'rock':
print("You lose 1 round")
print("computer: " + rps)
elif answer== 'scissors' and rps== 'paper':
print("You win 1 round")
print("computer: " + rps)
elif answer== 'scissors' and rps== 'scissors':
print("You tied with the computer")
print("computer: " + rps)
else:
print("INVALID GUESS!!!!!!!!!!!!!!!!!!!!!!!!!!!")

Comments
hotnewtop
ChristopherLi5 (13)

Are you a beginner​, intermediate, or advanced Python programmer​?

PreethiChander (1)

intermediate(maybe?)

ChristopherLi5 (13)

Do you know functions? (I am intermediate, but still a noob)