def append_with_limit(lst, val, limit=10):
    """Non-destructive function that returns a copy of the original list with the appended value and limit."""
    lst_copy = lst[:]
    lst_copy.append(val)
    return lst_copy[-limit:]