1,使用set函数,set(list)

2,使用字典函数,

>>>a=[1,2,4,2,4,5,6,5,7,8,9,0]

>>> b={}

>>>b=b.fromkeys(a)

>>>c=list(b.keys())

>>> c

 

相关文章:

  • 2021-07-29
  • 2022-12-23
  • 2021-12-16
  • 2021-10-10
  • 2022-12-23
  • 2021-12-02
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-22
  • 2022-02-07
  • 2021-10-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案