

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 5
click for more info
Not enough gems
Cost: 6 gems
1: Loops
incomplete
2: Loops Practice
incomplete
3: Loops Practice
incomplete
4: Loop Review
incomplete
5: Loop Review
incomplete
6: Whitespace in Python
incomplete
7: Range Continued
incomplete
8: Sum Game
incomplete
9: Sum Game 2
incomplete
10: While
incomplete
11: Continue Statement
incomplete
12: Break Statement
incomplete
13: Match Countdown
incomplete
14: Experience Points
incomplete
15: Meditate
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
In Fantasy Quest, characters can "meditate" to drink mana potions and regain mana over time.
Complete the meditate function using a while loop. It accepts:
mana: the current mana of the character.max_mana: the maximum mana of the character.num_potions: the number of mana potions the character has.It consumes potions one at a time until either:
Each potion restores 1 point of mana.
When the meditation is over, it returns the player's mana and the number of potions left, in that order.