Commit 84d81f0f authored by Siu, Pui Chung's avatar Siu, Pui Chung
Browse files

Upload New File

parent e8c4a35e
def debruijn(patterns):
result = {}
for i in patterns:
if i[:-1] not in result.keys():
result[i[:-1]] = i[1:]
else:
result[i[:-1]] += ','+ i[1:]
return result
if __name__ == '__main__':
with open('rosalind_dbru.txt', 'r') as f:
p = [line.strip() for line in f.readlines()]
res = debruijn(p)
for i in sorted(res.keys()):
print(i+' -> '+res[i])
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment