Stone paper sissor (Project - 6 )

Project - 6

Stone , Paper and scissor

To make this program you should simpaly need to know about basics of python programminf it seems to be veery difficult but is is not so ,m its very easy with some common sense and littel hardwork and faliurs .


Code is as below -- 


import random  
print ("If you want to play with your computer then press (1)")
print ( "If you want to paly with friend then print (2)" )
choice = input ( "Enter your choice to play with :- " )
if choice == "1":
    print('''Instructions
         Type (P) for choosing paper
         Type (S) for choosing Stone
         Type (C ) for choosing scissor ''')
    userwicomp=input ( "Enter your name:- ")
    print ( "Welcome to computer mode",userwicomp)
    userwcomp=input ("Enter your choice :-")
    S= "Stone"
    P="Paper "
    C="Scissor "
    mylist = ["P", "C", "S"]
    comp= (random.choice(mylist))
    print ("You chooses ",userwcomp)
    print ("computer chooses ",comp)
    if userwcomp==comp:
        print ( " Game is in tie you can again !!!!")
    elif userwcomp=="P" and comp=="S":
        print ("You Win!!")
    elif userwcomp == "S" and comp =="C":
        print ("You Win!!")
    elif userwcomp =="C " and comp== "S":
        print ("You Win!!")
    else:
        print ("Computer win  . Youshould try again ")

elif choice == "2" :
    print('''Instructions
         Type (P) for choosing paper
         Type (S) for choosing Stone
         Type (C ) for choosing scissor ''')
    S= "Stone"
    P="Paper "
    C="Scissor "
    fir=input ( "Enter first person name :-")
    fir1=input ("Enter your choice = ")
    fire= input ( "Enter the name for second person :-")
    fir2=input("Enter your choice = ")
    print (fir,"chooses")
    print(fir1)
    print (fire,"chooses")
    print(fir2)
    if fir1==fir2:
        print ("Game is in tie ")
    elif fir1 == "P" and fir2 =="S":
        print (fir,"Win!!!")
    elif fir1 =="S" and fir2=="C" :
         print (fir,"Win!!!")
    elif fir1=="C" and fir2=="S":
         print (fir,"Win!!!")
    else:
        print (fire,"Win!!!")






0 Comments