

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 4
click for more info
Not enough gems
Cost: 6 gems
1: Comparison Operators
incomplete
2: Comparison Operator Evaluations
incomplete
3: Comparison Practice
incomplete
4: If Statements
incomplete
5: If Practice
incomplete
6: If-Else
incomplete
7: If-Else Practice
incomplete
8: If-Else Practice
incomplete
9: Boolean Logic
incomplete
10: Boolean Quiz
incomplete
11: Should Serve Drinks
incomplete
12: Mount Rental
incomplete
13: Combat Advantage
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Fantasy Quest doesn't have any way for players to know if they are strong enough to hold their own against certain enemies.
On line 4 write an if/elif/else block. Using the rules specified above, set advantage, disadvantage, or evenly_matched to True depending on the values of player_power and enemy_defense.
For example, if the player's power is greater than the enemy's defense, advantage should be set to True. Set the variable inside each branch; don't return from the branch. The existing return at the bottom returns all three values.