from random import choice list=["r","s","p"] selection,player="y","" while selection!= "n": player_score=0 computer_score=0 while computer_score<3 and player_score<3: player=input("please make your move : \\t") while player not in list: player=input("please make your move :\\t") computer=choice(list) print(f"computer selection is: \\t{computer}") if computer==player: print(f"computer score : {computer_score} and your score :{player_score}" ) continue elif computer==list[(list.index(player)+1)%3]: player_score+=1 print(f"computer score : {computer_score} and your score :{player_score}" ) if player_score>=3: print (f"{player_score} vs {computer_score} wins player") break else: computer_score+=1 print(f"computer score : {computer_score} and your score :{player_score}" ) if computer_score>=3: print (f"{computer_score} vs {player_score} wins computer") selection=input("do u want play again? (Y/N)").lower()