Skip to content

Instantly share code, notes, and snippets.

@EeeasyCode
Created January 3, 2023 12:36
Show Gist options
  • Save EeeasyCode/64bf18ac9abecf48ce517579e6730196 to your computer and use it in GitHub Desktop.
Save EeeasyCode/64bf18ac9abecf48ce517579e6730196 to your computer and use it in GitHub Desktop.
# 기본적인 집합 초기화
S = set()
# 원소를 추가
S.add(i)
# 집합을 공집합으로 만들 경우
S.clear()
# remove 메소드도 있지만, 집합에 없는 수를 제거하려고 할 때, remove는 오류를 발생시키므로
# discard()를 사용
S.discard(k)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment