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 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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

6th Jun 2020, 5:54 PM
Elliot
2 Answers
+ 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.
6th Jun 2020, 6:43 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 2
thanks it worked
9th Jun 2020, 7:09 AM
Elliot