Skip to content

Commit 5ed3e07

Browse files
authored
Remove Duplicates from a list
Python Program to remove duplicates from a List Input : [2, 4, 10, 20, 5, 2, 20, 4] Output : [2, 4, 10, 20, 5]
1 parent ff29792 commit 5ed3e07

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

duplicates.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
def Remove(duplicate):
2+
final_list = []
3+
for num in duplicate:
4+
if num not in final_list:
5+
final_list.append(num)
6+
return final_list
7+
duplicate = [2, 4, 10, 20, 5, 2, 20, 4]
8+
print(Remove(duplicate))

0 commit comments

Comments
 (0)