I'm new at python so I'm not sure if this is the best approach.
I have 2 lists with the same amount of values. I want to compare the values of each index from the 2 lists i.e index 1 of player 1 to player 2, index 2 of player 1 to player 2 and so on.
if index 1 of player 1 to player 2 values are matched add 2 points and skip the next index on both lists. Having trouble figuring out how to skip the next index if both values of index 1 are a matched. Please help.
This is my code:
player1 = ['yes', 'deal', 'no', 'no deal', 'no', 'deal']
player2 = ['yes', 'no deal', 'yes', 'deal', 'no', 'deal']
count = 0
skip_count = 0
for i in range(len(player1)):
if player1[i] == player2[i]:
count += 2
skip_count = 0
else:
count += 1
when I print count, it doesn't skip as I want it to any thoughts?