def time_to_num(time):
    """
    time: a string representing a time, with hour and minute separated by a colon (:)
    Returns a number

    e.g. time_to_num(9:00) -> 9
         time_to_num(21:00) -> 21
         time_to_num(12:30) -> 12.5
    """
    time_comps = time.split(":")
    if int(time_comps[1]) == 0:
        return int(time_comps[0])
    return int(time_comps[0]) + int(time_comps[1])/60