I am writing a program for counting the score of two users. The game ends when either of them scores a ten and the respective player wins.
I wrote the while loop as:
while (score1 != 10) or (score2 != 10):
...
and my program does not terminate.
Here is the code:
player1 = input("Enter name for Player1")
player2 = input("Enter name for Player2")
score1=0
score2=0
print ("Score for Player1 is: %d,Score for player2 is :%d" %(score1,score2))
while (score1 != 10) or (score2 != 10):
player =input("enter name for player")
if player is player1:
score1=score1+1
if player is player2:
score2=score2+1
print ("Score for Player1 is: %d,Score for player2 is :%d" %(score1,score2))