Solution to List Remove Duplicates using functions in Python

Here is the solution to List Remove Duplicates using functions in Python which is given below:

def removeDuplicatesList(duplicate):
final_list = [ ]
for num in duplicate:
if num not in final_list:
final_list.append(num)
return final_list

lst = [ ]

n = int(input("Enter number of elements : "))

for i in range(0, n):
ele = int(input())
lst.append(ele)

print("The list before removing duplicates : " + str(lst))

print ("The list after removing duplicates : " + str(removeDuplicatesList(lst)))