0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 3
click for more info
No active XP Potion
Accept a Quest
Login to submit answers
In Python, numbers without a decimal point are called Integers
- just like they are in mathematics.
Integers are simply whole numbers, positive or negative. For example, 3
and -3
are both examples of integers.
Arithmetic can be performed as you might expect:
2 + 1
# 3
2 - 1
# 1
2 * 2
# 4
3 / 2
# 1.5 (a float)
This one is actually a bit different - division on two integers will actually produce a float. A float
is, as you may have guessed, the number type that allows for decimal values.
Complete the missing sections of the calculate_damage
function.
total_damage
variable so that it contains the sum of all the different weapons' and spells' damage values.average_damage
variable so that it contains the average of the combined weapon and spell damage.Focus Editor
Alt+Shift+]
Next Tab
Alt+Shift+[
Become a member to Submit
Become a member to Run
Become a member to view solution