0
What is Modulo?
You can use floor division to find the number of hours, and the modulo operator to find the remaining minutes.
4 Answers
+ 1
Modulo is remainder. You straight up said it in the description. 3 % 2 == 1
+ 1
Okay, thanks for explaining the problem. The math isn't that bad.
- You start with a number of minutes.
- We know there are 60 minutes in an hour.
- To get a whole number of hours (no remainder) we use //
- To get the remainer, we use the same numbers but with the
% (<-- modulo)
0
Hi, seems like I don't understand the question. Sorry I'm noob.
Random task! You need to calculate the number of hours in 888 minutes.
Your program needs to output the number of hours and then the number of remaining minutes, on separate lines.
For example, 72 minutes are equal to 1 hour and 12 minutes, so your program would output:
1
12
0
Okay, it worked. Thanks