Skip to content

Commit 5cb0729

Browse files
updated defend() stub
1 parent 7361403 commit 5cb0729

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

practice/unit_4/exercise_2.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,14 @@ def defend(character, incoming_damage):
159159
Calculate the amount the incoming_damage will be reduced
160160
based on the character's 'defense' stat.
161161
162-
Return the 'reduced_damage'
162+
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%
163166
'''
164167

165-
# ... your code here ...
166-
167-
return reduced_damage
168+
# return the reduction amount, rounded to the nearest integer
169+
return round(damage_reduction)
168170
```
169171

170172
<br>

0 commit comments

Comments
 (0)