#-*- coding:utf-8 -*-
answer0 = 'a'
answer1 = 'b'
answer2 = 'c'
answer3 = 'b'
answer4 = 'd'
passPhrases = (answer0, answer1, answer2, answer3, answer4, )
sets = set('')
ret = []
size = 0
for item in passPhrases:
sets.add(item)
if len(sets)== size:
ret.append(item)
size = len(sets)
print ret
dups = {}
for dup in ret:
duplist = []
pos =0
for item in passPhrases:
if item == dup:
duplist.append(pos)
pos =pos + 1
dups[dup] = duplist
print dups
0 件のコメント:
コメントを投稿