Skip to content

Instantly share code, notes, and snippets.

@libert-xyz
Created January 8, 2016 17:08
Show Gist options
  • Select an option

  • Save libert-xyz/d5756da157739dc7bc31 to your computer and use it in GitHub Desktop.

Select an option

Save libert-xyz/d5756da157739dc7bc31 to your computer and use it in GitHub Desktop.
def duplSets(l):
l = set(l)
print (l)
#Libert R Schmidt
# http://www.practicepython.org/exercise/2014/05/15/14-list-remove-duplicates.html
def duplLoop(l):
newL=[]
for i in l:
if i not in newL:
newL.append(i)
print (newL)
l = [1,2,3,4,5,0,1,2,3,4,5,6,7,8,9,0]
duplSets(l)
duplLoop(l)
@mprat
Copy link
Copy Markdown

mprat commented Mar 9, 2016

Great!

@Jonas901
Copy link
Copy Markdown

Jonas901 commented Jul 1, 2017

Cool

@is2real
Copy link
Copy Markdown

is2real commented Feb 26, 2019

How are you printing the list in order on the first function, if your never set them to get order?
image

@chuongle1994
Copy link
Copy Markdown

cool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment