Hide comma after the last element in array or dict