Challenge: Sweet Score Part 3 Error

Not sure if the image is visible above, but basically I have put a correct answer in, but it is not being accepted. The prompt i recieve is quote:
"Is the new parameter you added to get_score() named cherries? It should be named cherries to match the naming convention set by the other fruit cards."
My code is: (I have highlighted the section the error is referring to)
def get_banana_score(num_bananas):
"""Returns a player's score based on the number of banana cards.
Bananas are worth more in bunches.
"""
if num_bananas == 1:
return 1
elif num_bananas == 2:
return 4
elif num_bananas >= 3:
return 10
else:
return 0
def get_apple_score(num_apples, has_poison_apple):
"""Returns a player's score based on the number of apple cards.
The poison apple card turns the apple score negative.
"""
if has_poison_apple == 1:
return num_apples * -2
else:
return num_apples *2
def get_cherry_score(num_cherries):
cherry_pairs = num_cherries // 2
return cherry_pairs * 5
def get_score(bananas, apples, poison_apples, cherries):
"""Returns a player's total score based on their cards of each type."""
banana_score = get_banana_score(bananas)
apple_score = get_apple_score(apples, poison_apples)
cherry_score = get_cherry_score(cherries)
return banana_score + apple_score + cherry_score
# Calculate the final score for each player.
player1_score = get_score(3, 2, True, 4)
player2_score = get_score(1, 5, False, 2)
print("Scores: p1=" + str(player1_score) + ", p2=" + str(player2_score))
If anyone could help me on this error (bug or whatever) that'd be great :)
- Jai
*EDIT*
right click image to open in new tab - it's a lot clearer to see.


Iniciar sesión para dejar un comentario.