"Python 교집합 intersection()"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-</source> +</syntaxhighlight>, -<source +<syntaxhighlight ))
 
(다른 사용자 한 명의 중간 판 2개는 보이지 않습니다)
2번째 줄: 2번째 줄:
;Python 교집합 intersection()
;Python 교집합 intersection()


==set intersection 예제 (교집합)==
<syntaxhighlight lang='python' run>
<source lang='python' run>
s1=set([1,2,3,4,5])
s1=set([1,2,3,4,5])
s2=set([4,5,6,7,8])
s2=set([4,5,6,7,8])
print(s1, s2)
print(s1, s2)
print(s1.intersection(s2))
print(s1.intersection(s2))
</source>
</syntaxhighlight>


==같이 보기==
==같이 보기==
15번째 줄: 14번째 줄:


[[분류: Python 집합]]
[[분류: Python 집합]]
[[분류: 교집합]]

2023년 11월 7일 (화) 23:16 기준 최신판

1 개요[ | ]

Python 교집합 intersection()
s1=set([1,2,3,4,5])
s2=set([4,5,6,7,8])
print(s1, s2)
print(s1.intersection(s2))

2 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}