Skip to content

Instantly share code, notes, and snippets.

@ashitaka1963
Created April 27, 2020 22:21
Show Gist options
  • Save ashitaka1963/c65c1a8d474d9156d48d6a6fa007558d to your computer and use it in GitHub Desktop.
Save ashitaka1963/c65c1a8d474d9156d48d6a6fa007558d to your computer and use it in GitHub Desktop.
リストの重複削除
list = [1, 1, 2, 3, 3, 4]
print(set(list)) # {1, 2, 3, 4}
print(len(set(list))) # 4
# 参考
# [配列の重複を削除・抽出する|Python - suzu6](https://www.suzu6.net/posts/97-python-duplication/)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment