ν©μ§ν©κ³Ό κ΅μ§ν© ꡬνκΈ° - λ¬Έμ νμ΄
ν©μ§ν©κ³Ό κ΅μ§ν©μ ννλ‘ λ°ννλ 3κ°μ§ νμ΄ λ°©λ²μ νμΈν΄ 보μΈμ.
λ°©λ² 1
def solution(set1, set2): return (set1 | set2, set1 & set2)
μμ μ½λλ₯Ό μ¬μ©νλ©΄ μ
λ ₯λ λ μ§ν© set1
κ³Ό set2
μ ν©μ§ν©κ³Ό κ΅μ§ν©μ ꡬν μ μμ΅λλ€.
μ¬μ© μμ
μ
μΆλ ₯ μμ
set1 = {1, 2, 3, 4, 5} set2 = {3, 4, 5, 6, 7} result = solution(set1, set2) print(result) # μΆλ ₯: ({1, 2, 3, 4, 5, 6, 7}, {3, 4, 5})
Guidelines
AI Tutor
Publish
Design
Upload
Notes
Favorites
Help