Mistři v programování na #hovnokod

Python #4348

def validate(timeinstr):
    if timeinstr:
        timeinstr = timeinstr.split(':')
        if len(timeinstr) != 2:
            return 0, 0
        hour = int(timeinstr[0])
        minute = int(timeinstr[1])
        if (hour < 0) or (hour > 23):
            return 0, 0
        if (minute < 0) or (minute > 59):
            return 0, 0
        return hour, minute
    return 0, 0

Anonymous,