From b64fefcc572b88adcb74cbc42d640d90b00a7724 Mon Sep 17 00:00:00 2001 From: ashish199912 <31989216+ashish199912@users.noreply.github.com> Date: Mon, 19 Oct 2020 16:54:38 +0530 Subject: [PATCH] Remove Duplicate Function Removing duplicates from lists, is a low-key-yet-totally-on-point Python example . --- Remove_Duplicate_Function | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 Remove_Duplicate_Function diff --git a/Remove_Duplicate_Function b/Remove_Duplicate_Function new file mode 100644 index 00000000..90b88cd1 --- /dev/null +++ b/Remove_Duplicate_Function @@ -0,0 +1,10 @@ +def remove_duplicates(lista): + lista2 = [] + if lista: + for item in lista: + if item not in lista2: #is item in lista2 already? + lista2.append(item) + else: + return lista + return lista2 +print remove_duplicates([1,2,3,3])