I’m busy with this practice question and solved for it however when the correction machine checks it, it tells me that my solution results in NONE when inputting [0, 0]. When I create a variable with [0,0] the output is correct “00:00”. Can somebody help me see what is going wrong?
Write a function named format_time with:
hour: An integer representing the hour
minute: An integer representing the minute
Your function should format the provided hour and minute into a string with five characters as described above
Test your function by printing the result on the provided inputs. For example, you can test it on the first input by executing print(format_time(hour_1, minute_1)).
Your function will also be checked by being executed on a set of hidden inputs
def format_time(hour, minute): time1 = str(hour) time2 = str(minute) if len(time1) == 1: time1 ='0'+ time1 if len(time2) == 1: time2 ='0' + time2 else: time1, time2 timeformat = print(time1 + ':' + time2)