Learn practical skills, build real-world projects, and advance your career

rock-paper-scissors-game

Use the "Run" button to execute the code.

!pip install jovian --upgrade --quiet
import jovian
# Execute this to save new versions of the notebook
jovian.commit(project="rock-paper-scissors-game")
win=0
for i in range(10):
    my_choice=int(input("Type 0 for Rock 1 for Papers and 2 for scissors\n"))
    games_images =["Rock","Paper","Scissors"]
    print(f"Your choice is {games_images[my_choice]}")

    import random
    comp_choice=random.randint(0,2)

    print(f"Comp choice is {games_images[comp_choice]}")

    
    if my_choice>3 or my_choice<0:
        print("Invalid input you lose the match")
        continue
    elif my_choice==comp_choice:
        print("Match drow try again")
    elif my_choice==0 and comp_choice==2:
        print("You win")
        win+=1
    elif my_choice==2 and comp_choice==0:
        print("You lose")
    elif my_choice< comp_choice:
        print("You lose")
    elif my_choice> comp_choice:
        print("You win")
        win+=1
    print(f"Out of 10 you win {win}")