皇冠足球体育

If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Challenge: Sweet scores

Instructions

Step 1

Handle poison apples

Aiyana designed a fruit-themed card game, where cards can either be apples or bananas. She’s working on a scoring system, which she’s split into functions.

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.

You’ll need to use the boolean has_poison_apple parameter, which contains True if the player has the poison apple card.

Code editor

Code files

Output