python 列表推导的注意点

Code

1 a = [1,2,2,3]
2 b = [for item in a if item not in b]
3 
4 c = []
5 for item in a:
6     if item not in c:
7         c.append(item)

b -- [1,2,2,3]

c -- [1,2,3]

 

posted @ 2014-09-05 10:51  mess4u  阅读(127)  评论(0编辑  收藏  举报