Question: python You are writing a game and need a function to calculate what a character's experience points will be after a battle. Before the battle,

 python You are writing a game and need a function to

python You are writing a game and need a function to calculate what a character's "experience points" will be after a battle. Before the battle, the character has 55430 "experience points" (This would be stored in variable in the full program) and the function you write will take parameters for the points the character would earn if they win the battle as well as a boolean letting you know if the character was victorious in battle. Write a function named "compute_xp" that takes two parameters which are an integer and boolean in that order. The function will return the 55430 if the boolean is false (lost the battle) or 55430 plus the integer parameter if the boolean is true (won the battle)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!