Rock Paper Scissor Game in Python

 


Rock Paper Scissor Game in Python

import random
Moves=[
"rock","paper","scissor"]
while True:
    ccount=
0
   
ucount=0
   
uc=int(input('''
Game Start ......
1 Yes
2 No | Exit
    '''
))
   
if uc<=1:
       
for a in range(1,6):
            userInput=
int(input('''
1 Rock
2 Scissor
3 Paper
            '''
))
           
if userInput==1:
                un=
"rock"
           
elif userInput==2:
                un=
"scissor"
           
elif userInput==3:
                un=
"paper"
           
cn=random.choice(Moves)
           
if cn==un:
               
print("Computer Value",cn)
               
print("User Value",un)
               
print("Game Draw")
                ucount=ucount+
1
               
ccount=ccount+1
           
elif (un=="rock" and cn=="scissor") or (un=="paper" and cn=="rock") or (un=="scissor" and cn=="paper"):
               
print("Computer Value", cn)
               
print("User Value", un)
               
print("You Win")
                ucount=ucount+
1
           
else:
                
print("Computer Value", cn)
               
print("User Value", un)
               
print("Computer Win")
                ccount = ccount +
1
       
if ucount==ccount:
           
print("Final Game Draw..")
           
print("User Score",ucount)
           
print("Computer Score",ccount)
       
elif ucount>ccount:
           
print("Final You Win")
           
print("User Score", ucount)
           
print("Computer Score", ccount)
       
else:
           
print("Final Computer Win")
            
print("User Score", ucount)
           
print("Computer Score", ccount)
   
else:
       
break

<<Try yourself>>

 <<Previous                                                  Next>>

कोई टिप्पणी नहीं

टिप्पणी: केवल इस ब्लॉग का सदस्य टिप्पणी भेज सकता है.

MS Excel to WhatsApp Bulk Message in single Click

Excel to WhatsApp Bulk Message VBA Code File Download VBA Note Pad File - Click here Download Excel Practice File - Click here Copy Code her...

Blogger द्वारा संचालित.