STONE PAPER SCISSOR GAME WITH COMPUTER
import random
print(" welcome to stone paper and scissors game ")
print(" ")
num=1
u=0
c=0
for i in range(0,10):
left=10
list = ["s", "p", "c"]
choice = random.choice(list)
print("Computer has guessed!! , Your turn.")
print("")
print("Press (s) for Stone\n"
"Press (p) for Paper\n"
"Press (c) for Scissors\n")
userc=str(input("enter your choice -> "))
if userc==choice:
print("You both have chossen same")
if userc=="s" and choice=="c":
print("Yay!!, you have won")
u=u+1
if userc=="s" and choice=="p":
print("Oh!! Computer has won")
c=c+1
if userc=="p" and choice=="s":
print("Yay!!, You have won")
u=u+1
if userc=="p" and choice=="c":
print("Oh!! Computer has won")
c = c + 1
if userc=="c" and choice=="s":
print("Oh!! Computer has won")
c = c + 1
if userc=="c" and choice=="p":
print("Oh!! Computer has won")
c = c + 1
left=left-1
print("Match will finish in -> ",left," matches. ")
print("So the total scores is\n")
print("Computer -> ",c)
print("User -> ",u)
print(" ")
print("FINAL RESULT")
if c>u:
print("COMPUTER HAS WON THE MATCH")
else:
print("USER HAS WON THE MATCH")
Comments
Post a Comment