Skip to content

Instantly share code, notes, and snippets.

@wudaown
Created February 2, 2013 12:45
Show Gist options
  • Save wudaown/4697160 to your computer and use it in GitHub Desktop.
Save wudaown/4697160 to your computer and use it in GitHub Desktop.
#!/usr/local/bin/python3.2
# _*_ coding:utf8 _*_
def durian():
"""docstring for durian"""
infile=open("test","r").read()
list=infile.split(",")
print(list)
dlist=[]
for i in range(len(list)):
print(i)
dlist.append(list[i][0])
dlist.append(list[i][2])
print(dlist)
seen = set()
seen_add = seen.add
dlist=[x for x in dlist if x not in seen and not seen_add(x)]
dlist.sort()
rep = []
for i in range(len(dlist)):
rep.append(0)
print(list)
print(rep)
for i in range(len(list)):
if list[i][1] == ">":
print("greater")
if list[i][0] in dlist:
rep[i] = i + 1
else:
print("smaller")
print(rep)
return dlist
print(durian())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment