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 * 2 = 18
         time_to_num("21:00") -> 21 * 2 = 42
         time_to_num("12:30") -> 12.5 * 2 = 25
    """
    time_comps = time.split(":")

    assert len(time_comps) == 2;
    assert int(time_comps[1]) == 0 or int(time_comps[1]) == 30

    result = int(time_comps[0])*2
    return result if int(time_comps[1]) == 0 else result + 1