0
I tried my own but it shows error
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 https://code.sololearn.com/cV1cPSQysQyd/?ref=app I know answer of this question , but I just simply tried input() in this code it shows error why?đ¤đ¤đ¤đ¤đ¤¨đ¤¨đ¤¨
5 Answers
+ 4
You need to change the input to integer by using int().
input() take input as String.
t=int(input())
+ 4
Your code is a perfect place to use the built-in Python function divmod().
+ 1
Thasneem Mohamed
It sounds like you have a syntax problem, not a logic problem.
As Vadivelan stated, we can't really help you if we can't see your code.
If you don"t know how to post your code, then please lrt us know
+ 1
Superb vadivelan brođđđđđ
+ 1
t = int(input())
h = 60
H = (t//h) #hours
print(H)
M = (t%h) #Minutes
print(M)