We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7361403 commit 5cb0729Copy full SHA for 5cb0729
practice/unit_4/exercise_2.md
@@ -159,12 +159,14 @@ def defend(character, incoming_damage):
159
Calculate the amount the incoming_damage will be reduced
160
based on the character's 'defense' stat.
161
162
- Return the 'reduced_damage'
+ Return the amount the incoming_damage will be reduced
163
+ in a variable called 'damage_reduction'
164
+
165
+ 0 - 4 = 10%, 5 - 7 = 33%, 8 - 10 = 66%
166
'''
167
- # ... your code here ...
-
- return reduced_damage
168
+ # return the reduction amount, rounded to the nearest integer
169
+ return round(damage_reduction)
170
```
171
172
<br>
0 commit comments