Python 3 Script to Remove Duplicates Elements From List or Array

Python 3 Script to Remove Duplicates Elements From List or Array

Python 3 Script to Remove Duplicates Elements From List or Array

# Python code to remove duplicate elements
def Remove(duplicate):
    final_list = []
    for num in duplicate:
        if num not in final_list:
            final_list.append(num)
    return final_list
    
# Driver Code

duplicate = [2, 4, 10, 20, 5, 2, 20, 4]
print(duplicate)
print(Remove(duplicate))
Share on:

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Comment