def get_course_num(course_count, iput):
    """Gets the course # from user input. Returns -1 if invalid input

    Args:
        course_count (int): number of courses
        iput (string): raw user input string

    Returns:
        int: -1 if invalid user input. Otherwise the course number the user submitted
    """
    try:
        if 0 < int(iput.replace(".","")) <= course_count:
            return int(iput.replace(".","")) - 1
    except:
        return -1
    return -1