- 10
Random task! You need to calculate the number of hours in 888 minutes. Your program needs to output the number of hours
14 Respuestas
+ 13
minutes = 888
hours = 60
print(minutes//hours)
print(minutes%hours)
+ 3
You can use floor division to find the number of hours, and the modulo operator to find the remaining minutes.
Use separate print() statements for each output.
+ 1
#Code to calculate the number of hours in 888 minutes
minutes = 888 #minutes
hours = 60 #hours
print (minutes // hours) #floor division
print (minutes % hours) #modulo operator
0
Did u try solving this problem?
0
60 minutes => 1 hour
1 minute => 1/60 hour
888 minutes => (888/60) hours
0
0
Can i know the formula please
0
guys when you use calculate and put 888/60=14.8 but this is not hours and min so you need to count 0.8 = how many minutes, so the answer is 14h 48min
0
minutes = 888
hours = 60
print(minutes//hours)
print(minutes%hours)
0
n=888
h=int(n/60)
m=n%60
print(h)
print(m)
- 1
Once I figured out the second line I was good> Thank you so much Guys :)
- 2
Yes i solved this problem how to write in python
- 4
By using floor division and module