Question: Not sure where i went wrong on this defintion. Need help We are now ready to write the definition of the type _ bonus function,

Not sure where i went wrong on this defintion. Need help
We are now ready to write the definition of the type_bonus function, which will calculate the type bonus of an attack_type against a defender. We have provided a code snippet for you to work with. You may rewrite the entire function from scratch if you want to.
19]: def type_bonus(attack_type, defender):
# TODO: store the 'type1' and 'type2' of the 'defender' in variables
# 'defender_type1' and 'defender_type2'
# TODO: replace the ... with your code
defender_type1= defender.type 1
defender_type 2= defender.type 2
if defender_type2:
bonus = project.get_type_effectiveness(attack_type, defender_type1)
return bonus
else:
bonus = project.get_type_effectiveness(attack_type, defender_type2)
return bonus
 Not sure where i went wrong on this defintion. Need help

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!