---
title: "python去除列表里的重复记录"
author: "logo32"
date: "2019-09-03T11:14:23Z"
tags: []
categories: ["编程语言"]
slug: "python"
draft: false
lastmod: "2018-08-27T14:49:28Z"
id: 2429480
url: "https://logo32.iteye.com/blog/2429480"
---

```java
#方法1：
>>> mylist = [3,5,8,5,3,12]
>>> print dict().fromkeys(mylist).keys()
[8, 3, 12, 5]
>>>

#方法2：
>>> mylist = [3,5,8,5,3,12]
>>> print list(set(mylist))
[8, 3, 12, 5]
>>>
```