This Is my Program Code where I have created a function that is converting Hour to Min.
def convertToHM(Mins):
hours = Mins / 60
minutes = Mins % 60
return str(hours) + ':' + str(minutes)
Mins = int(input("Enter Minutes: "))
print("OutPut Is " + convertToHM(Mins))
OutPut Of the above Code. Enter Minutes: 63 OutPut Is 1.05:3
My Question Is why it is giving 1.05:3, I want my output as 1:3 where I am making Mistakes?
I even have tried to convert string to integer
return int(str(hours)) + ':' + int(str(minutes))
**Traceback (most recent call last):
File "<string>", line 14, in <module>
File "<string>", line 10, in convertToHM
ValueError: invalid literal for int() with base 10: '1.05'**
so it is giving me the above error.
How should I overcome this error? I am a very Beginner in Python Language