def quchu(items): seen = set() for item in items: if item not in seen: yield item seen.add(item) if __name__ == '__main__': a = [1,4,3,4,3,5,8] print(a) print(list(quchu(a)))
扫描二维码,关注牛客
下载牛客APP,随时随地刷题
全部评论
(0) 回帖