Create a Python program to remove all occurrences of the given element in a given array.
arr = [2, 4, 5, 7, 4, 2], element = 4
def remove_element(arr, element):
    arr = [x for x in arr if x != element]
    return arr