去掉重复之后还剩几个
运行下面这段程序:
words = ["苹果", "香蕉", "苹果", "梨", "香蕉", "苹果"]
seen = {}
for w in words:
seen[w] = True
print(len(seen))
运行下面这段程序:
words = ["苹果", "香蕉", "苹果", "梨", "香蕉", "苹果"]
seen = {}
for w in words:
seen[w] = True
print(len(seen))
全部评论