Converting Spell Cooldowns
In World of Software Engineering, spell cooldowns are stored internally in minutes.However, the game engine processes all timed events in seconds.
Even more precisely, spell casts can begin within milliseconds.
To ensure perfect timing, we need to convert between these units.
Let’s break this down carefully.
1 minute = 60 seconds
1 second = 1000 milliseconds
So the full conversion path is:
minutes → seconds → milliseconds
1 minute = 60 seconds
1 second = 1000 milliseconds
So the full conversion path is:
minutes → seconds → milliseconds
Example:
If a cooldown is 3 minutes:
3 × 60 = 180 seconds
180 × 1000 = 180,000 milliseconds
If a cooldown is 3 minutes:
3 × 60 = 180 seconds
180 × 1000 = 180,000 milliseconds
We can combine this into one clean calculation:
minutes × 60 × 1000
minutes × 60 × 1000
Your Mission:
Write a function called convert_minutes_to_milliseconds.
It must:
• Accept minutes as a parameter
• Convert the value to milliseconds
• Return the result
Do not modify the testing code.
Write a function called convert_minutes_to_milliseconds.
It must:
• Accept minutes as a parameter
• Convert the value to milliseconds
• Return the result
Do not modify the testing code.
Complete the conversion function
def convert_minutes_to_milliseconds(minutes):
# return the cooldown time in milliseconds
# Don't touch below this line
def test(minutes):
ms = convert_minutes_to_milliseconds(minutes)
print(minutes, "minutes equals", ms, "milliseconds")
test(5)
test(1)
test(2.5)
test(10)