I am attempting to create a function with the following characteristics;
function name: new_scores,
parameters: (p1_score,p2_score,current_score,current_player)
p1_score: user inputed player 1 score,
p2_score: user inputed player 2 score,
current_score: the current score of set player after any actions performed
current_player: either 'PLAYER_ONE' or 'PLAYER_TWO'
the problem with my code is that it doesnt work in all cases, for example try replacing values in PLAYER_ONE, it just spits back out the p1_score, and p2_score that i inputed. Thanks for the help
def new_scores(p1_score,p2_score,current_score,current_player):
if current_player == 'PLAYER_ONE':
p1_score = current_score
return (p1_score,p2_score)
elif current_player == 'PLAYER_TWO':
p2_score = current_score
return (p1_score,p2_score)