โ ๐ Python World
๐ Screen Time
You can practise without a player, but pick a player to score points!
๐ The mission
Today you unlock
Functions return answers
A function is a tiny machine: it receives inputs, works something out, then returns one answer for the tests to check.
๐ก Hint ladder
- One hour is 60 minutes.
- return hours * 60
๐งช Coach checks
- โฏ 2 hours
- โฏ zero hours
- โฏ a school day
Live coach
Getting ready
โโโ
๐ฌ Units conversion = one multiply.
def to_seconds(minutes):
return minutes * 60
print(to_seconds(2)) # 120
print(to_seconds(10)) # 600
๐ It printed:
Nice โ you saw it work!
๐ Output
๐งฉ Gaps filled! Ready to write it all yourself?