+ 1

Stuck in lesson {solved}

Stuck in lesson 6.2by python for beginners have to make a code to see how many hours there are in 888 min and it should say remainder min if anyone can help with explaining Thanks

17th Aug 2021, 2:12 AM
Lz1234
7 Réponses
+ 1
it looks like a string input, not an int(input() You need to operate on numbers, not text
17th Aug 2021, 3:34 AM
Rik Wittkopp
Rik Wittkopp - avatar
+ 3
I don't know exactly what you are trying to do, but this might help mins = 888 hrs = mins // 60 remainder = mins % 60 print(hrs) print(remainder) Take note of the floor division // and the modulo operator %
17th Aug 2021, 2:46 AM
Rik Wittkopp
Rik Wittkopp - avatar
+ 2
Hint: Divide 888 by 60, you get hours. Use floor division operator to get a whole number. Modulo 888 by 60 you get remainder minutes. Good luck! 👍
17th Aug 2021, 2:44 AM
Ipang
+ 2
Thanks
17th Aug 2021, 2:52 AM
Lz1234
+ 2
Rik thanks you got the prob took out the ‘ and it worked
17th Aug 2021, 3:49 AM
Lz1234
+ 1
Put in. Print (‘888//60’) Print (‘888%60’) And it still does not work any ideas
17th Aug 2021, 2:59 AM
Lz1234
+ 1
Please like
17th Aug 2021, 6:34 PM
Lz1234