Write code to remove duplicates.
Implement def remove_duplicates(nums): for a list of integers. Return a new list containing each value once, preserving the order of its first appearance. The input may be empty, and the original list must not be modified.
def remove_duplicates(nums):