+ 1
Make a function to convert any number into hours and minutes. (For example, 71 will become “1 hour, 11 minutes; 133 will become
This is what I tried: def convertor(): minutes = 350 hours = 60 print(minutes//hours) print(minutes%hours) convertor()
2 Antworten
+ 5
Msawenkosi Zuma ,
taking your code and clean it up will be:
def convertor(minutes):
print(minutes // 60)
print(minutes % 60)
minutes = int(input())
convertor(minutes)
happy coding!
0
You don't have to make a variable hours just use number 60
this might help
print(str(minutes//60)+" hours "+str(minutes%60)+" minutes")
also try making the function take an input as an argument so it doesn't convert 350 minutes all the time