I wrote a simple script with a single function but i want to convert the result from float to an integer data type. Is it possible in this case?
This is the script
def minutes_to_hours(minutes):
hours=minutes/60
return hours
def seconds_to_hours(seconds):
hours=seconds/int(3600)
return hours
print(minutes_to_hours(100))
print(seconds_to_hours(int(3600)))
And the result is
1.6666666666666667
1.0
The result is correct but as you can see i want to change the data type from float to an integer (1
rather than 1.0
), is it possible?
Related to python functions.