How can we help?

Did you write all the other functions? They seem to have problems.

Hey, thanks for the reply :)

Partially; in Part 1 of the exercise I wrote the part

if has_poison_apple is True:
return num_apples * -2
else:
return num_apples * 2

which originally didn't include a formula to turn the score negative if it included a poison apple card; but when submitting the result it ran without error & was accepted as correct.

so the parts I wrote myself were:

- "poison apple" part of the apple_score code
- complete "cherry_score"
- additions to the final score to include the "cherry_score" result in addition to the others

You are supposed to apply the cherry function into the main function in step 3. Delete it and add it back in step 3.

Minor improvements:

1. In the apple function, you can just use the parameter itself (if has_poison_apple instead of if has_poison_apple is True)

2. In the cherry function, you can shortcut it by returning (num_cherrys // 2) * 5

just to confirm for my understanding - I thought that I did that with the part stated in bold letters below (after I defined the function earlier)?
I'm just struggling to understand why - if both the banana_score & apple_score function were first defined & then rolled together into the get_score function in the default code - it should be done differently for a 3rd part that goes into the same final function def_score?

def get_score(bananas, apples, has_poison_apple, cherrys):
"""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, has_poison_apple)
cherry_score = get_cherry_score(cherrys)

So in step 2 you are supposed to just define the function, and then step 3 add it in the main code.

It went as follows:
_____________________________________________________________________
1st exercise; given code:

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.
"""
return num_apples * 2

def get_score(bananas, apples, has_poison_apple):
"""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, has_poison_apple)

return banana_score + apple_score

# Calculate the final score for each player.
player1_score = get_score(3, 2, True)
player2_score = get_score(1, 5, False)
print("Scores: p1=" + str(player1_score) + ", p2=" + str(player2_score))
_________________________________________________________________________

Aiyana’s deck contains a single poison apple card. Normally, each apple card scores 2 points, but if a player has the poison apple, each of their apple cards scores -2 points!

• Update the `get_apple_score()` function body to include the poison apple rule in its score calculation.

__________________________________________________________________________
This I solved by adding the if else statement to return +2 / -2 per apple, depending on if has_poison_apple was True or False

__________________________________________________________________________
In the 2nd exercise, I was supposed to expand the code to include the cherry_score function,  with each pair of cherries counting for 5 points - which I tried to solve with the code I first showed, following the layout of the banana_score + apple_score functions (first defining it one by one, then including it into the get_score function as a 3rd part to add to the other 2 functions.

If I'm not missing something the code I wrote should return the correct value, but I always get a message that there's still some error in the code, even though the resulting score when I enter values for the amount of cherries to calculate the final scores seems to be correct.

Start over. Step one, update the apple function. Step 2, write the cherry function ONLY. Step 3, update the main function.

Ahhh, now I got to solve it - so I simply was a bit ahead of the second Step.
Sorry for taking up so much of your time & thanks for walking through it with me, now I can finally finish there & move on.
Appreciate the help a lot!

I hit the same issue. Thanks for sharing the issue and solution.