1 2 3 4 5 6 7 8 9 10 | # # µû¶óÇÏ¸ç ¹è¿ì´Â ÆÄÀ̽ã°ú µ¥ÀÌÅÍ°úÇÐ(»ý´ÉÃâÆÇ»ç 2020) # LAB 8-3 ÆÄƼ µ¿½Ã Âü¼®ÀÚ ¾Ë¾Æ³»±â, 210ÂÊ # partyA = set(["Park", "Kim", "Lee"]) partyB = set(["Park", "Choi"]) print("ÆÄƼ A, B¿¡ Âü¼®ÇÑ »ç¶÷µé : ", end="") for x in partyA.union(partyB): print(x, end=" ") | cs |
1 2 3 4 5 6 7 8 9 10 | # # µû¶óÇÏ¸ç ¹è¿ì´Â ÆÄÀ̽ã°ú µ¥ÀÌÅÍ°úÇÐ(»ý´ÉÃâÆÇ»ç 2020) # LAB 8-3 ÆÄƼ µ¿½Ã Âü¼®ÀÚ ¾Ë¾Æ³»±â, 210ÂÊ # partyA = set(["Park", "Kim", "Lee"]) partyB = set(["Park", "Choi"]) print("ÆÄƼ A, B¿¡ Áߺ¹¾øÀÌ Âü¼®ÇÑ »ç¶÷ : ", end="") for x in partyA.symmetric_difference(partyB): print(x, end=" ") | cs |
1 2 3 4 5 6 7 8 9 10 | # # µû¶óÇÏ¸ç ¹è¿ì´Â ÆÄÀ̽ã°ú µ¥ÀÌÅÍ°úÇÐ(»ý´ÉÃâÆÇ»ç 2020) # LAB 8-3 ÆÄƼ µ¿½Ã Âü¼®ÀÚ ¾Ë¾Æ³»±â, 210ÂÊ # partyA = set(["Park", "Kim", "Lee"]) partyB = set(["Park", "Choi"]) print("ÆÄƼ A¿¡¸¸ Âü¼®ÇÑ »ç¶÷ : ", end="") for x in partyA.difference(partyB): print(x, end=" ") | cs |