我想从下面的列表中获得唯一的值:
[u'nowplaying', u'PBS', u'PBS', u'nowplaying', u'job', u'debate', u'thenandnow']我需要的输出是:
[u'nowplaying', u'PBS', u'job', u'debate', u'thenandnow']此代码工作:
output = []for x in trends: if x not in output: output.append(x)print output有没有更好的解决方案,我应该使用?
相似问题