+ 3
How can i make my program count on python how many times me or the computer won you find my trial at the end of the program
for i in range(5): from random import t=["rock","paper","scissor"] computer=t[randint(0,2)] player=input("please choose") if player==computer: Print("tie") . . . . . Count=0 if player==t: Count=count+1 else: Count=count-1 if computer==t: count=count+1 else: count=count-1
2 Respostas
+ 3
You can introduce two variables - one for the PC and one for the player. And simply add 1, respectively after each round.
Just remember to indent everything within the starting for loop. Well, everything apart from the import part - that should be done only once per runtime.
+ 2
thanks it worked