1. Engineering
  2. Computer Science
  3. kindly i need help in this python code problem recall...

Question: kindly i need help in this python code problem recall...

Question details

Kindly I need help in this python code problem:

#Recall Coding Problem 2.4.4. In that problem, you calculated
#the damage done by an attack based on several parameters.
#
#Convert your code from there into two functions, one called
#calculate_damage and one called calculate_modifier.
#
#Your function for calculate_damage must call calculate_modifier;
#it may not calculate the modifier separately. As such,
#calculate_damage should accept all ten parameters: STAB,
#Type, Critical, Other, Random, Level, Attack, Defense, and
#Base. You'll need to pass STAB, Type, Critical, Other, and
#Random to calculate_modifier.
#
#Make sure the parameters to each function follow the order
#shown above.
#
#As a reminder, damage is calculated using this formula:
#courses.edx.org/asset-v1:GTx+CS1301xII+1T2018+type@
#
#Modifier is calculated using this formula:
#https://studio.edx.org/asset-v1:GTx+CS1301+1T2017+type@


#Add your code here!

#Below are some lines of code that will test your function.
#You can change the value of the variable to test your
#function with different inputs.
#
#If your function works correctly, this will originally
#print: 16.0
STAB = 1
Type = 0.25
Critical = 2
Other = 1
Random = 1
Level = 50
Attack = 125
Defense = 110
Base = 60

print(calculate_damage(STAB, Type, Critical, Other, Random, Level, Attack, Defense, Base))

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution