CodePudding user response:
.==="and"CodePudding user response:
According to your logic of writing this kind of method is right, but the case may be more suitable for this topic more clear and more clearimport random
For I in range (5) :
Player=int (input (" please enter the player to the punch, with 0 means stone, scissors, with 1 said with 2 said: '))
Computer=random. Randint (0, 2)
Print (" the computer is: ", computer)
If (player==0 and computer==1) or (player 1 and computer====2) or (player 2 and computer====0) :
Print (' players won ')
Elif (player==0 and computer==2) or (player 1 and computer====0) or (player 2 and computer====1) :
Print (' players lost ')
The else:
Print (", draw out ")
If (I==4) or (player==3) :
Break