def replace_tuple(tuple_obj, replace_obj, replace_index):
    """Create a new tuple with a new object at index"""
    if len(tuple_obj) - 1 <= replace_index:
        return tuple_obj[:replace_index] + (replace_obj,) 
    else:
        return tuple_obj[:replace_index] + (replace_obj,) + tuple_obj[replace_index+1:]