Play the classic game of rock-paper-scissors using this Python code. Easy to understand, with a simple interface and user-friendly design. Try your luck against the computer and see if you have what it takes to win! Enjoy this simple and fun coding project, perfect for beginners or those looking to improve their Python skills.
import random
print("1.paper\n2.sciccor\n3.rock")
z=int(input())
if(z==3 or z==2 or z==1):
if (z == 1 ):
l=print("User decision is:- paper")
elif(z==2):
l=print("User decision is:- scissor")
else:
l=print("User decision is:- rock")
c_choice=random.randint(1,3)
if (c_choice == 1 ):
a=print("Computer decision is:- paper")
elif(c_choice==2):
b=print("Computer decision is:- sciccor")
else:
c=print("Computer decision is :-rock")
if (z==1 and c_choice==3):
print("paper wins---> USER IS WINNER")
elif(z==2 and c_choice==1):
print("sciccor wins---> USER IS WINNER")
elif(z==3 and c_choice==2):
print("rock wins---> USER IS WINNER")
elif(z==1 and c_choice==1)or(z==3 and c_choice==3)or(z==2 and c_choice==2) :
print("**Game is draw**")
elif(c_choice==1 and z==3):
print("paper wins---> COMPUTER IS WINNER")
elif(c_choice==2 and z==1):
print("sciccor wins---> COMPUTER IS WINNER")
else:
print("rock wins---> COMPUTER IS WINNER")
else:
print("Enter number between 1-3")