{"cells": [{"cell_type": "code", "execution_count": 1, "metadata": {"school_cell_uuid": "35d617ceeb60454ea166db11a86af692"}, "outputs": [{"data": {"text/plain": ["{1, 2, 3}"]}, "execution_count": 1, "metadata": {}, "output_type": "execute_result"}], "source": ["A = set([1, 2, 3, 3, 2]) # \uc911\ubcf5\ub41c \uc790\ub8cc\ub294 \uc5c6\uc5b4\uc9c4\ub2e4.\n", "A"]}, {"cell_type": "code", "execution_count": 2, "metadata": {"school_cell_uuid": "de5759a5fd864d26ac796805ab855a1f"}, "outputs": [{"data": {"text/plain": ["frozenset({'H', 'T'})"]}, "execution_count": 2, "metadata": {}, "output_type": "execute_result"}], "source": ["B = frozenset(['H', 'T'])\n", "B"]}, {"cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [{"data": {"text/plain": ["{'\u2660', '\u2661', '\u2662', '\u2663'}"]}, "execution_count": 3, "metadata": {}, "output_type": "execute_result"}], "source": ["C = {\"\\u2660\", \"\\u2661\", \"\\u2662\", \"\\u2663\"}\n", "C"]}, {"cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [{"data": {"text/plain": ["set"]}, "execution_count": 4, "metadata": {}, "output_type": "execute_result"}], "source": ["type(C)"]}, {"cell_type": "code", "execution_count": 5, "metadata": {"school_cell_uuid": "7b1aacc2386540f3b54a745f6a4b1b9b"}, "outputs": [{"data": {"text/plain": ["(3, 2, 4)"]}, "execution_count": 5, "metadata": {}, "output_type": "execute_result"}], "source": ["len(A), len(B), len(C)"]}, {"cell_type": "code", "execution_count": 6, "metadata": {"school_cell_uuid": "577fe6bb68d8427aa44f3d415de31e8a"}, "outputs": [], "source": ["A1 = set([1, 2, 3, 4])\n", "A2 = set([2, 4, 6])\n", "A3 = set([1, 2, 3])\n", "A4 = set([2, 3, 4, 5, 6])"]}, {"cell_type": "code", "execution_count": 7, "metadata": {"school_cell_uuid": "854dd4c4d23c4b45ac6615addc0e4eff"}, "outputs": [{"data": {"text/plain": ["{1, 2, 3, 4, 6}"]}, "execution_count": 7, "metadata": {}, "output_type": "execute_result"}], "source": ["A1.union(A2)"]}, {"cell_type": "code", "execution_count": 8, "metadata": {"school_cell_uuid": "27f40b25380b4df1a6d17ea5d7adc36a"}, "outputs": [{"data": {"text/plain": ["{1, 2, 3, 4, 6}"]}, "execution_count": 8, "metadata": {}, "output_type": "execute_result"}], "source": ["A2 | A1"]}, {"cell_type": "code", "execution_count": 9, "metadata": {"school_cell_uuid": "838ae0cfb9944f329e87d0f293b4fad8"}, "outputs": [{"data": {"text/plain": ["{2, 3}"]}, "execution_count": 9, "metadata": {}, "output_type": "execute_result"}], "source": ["A3.intersection(A4)"]}, {"cell_type": "code", "execution_count": 10, "metadata": {"school_cell_uuid": "c400a0dfe5504bee8caa30d698dc5eb2"}, "outputs": [{"data": {"text/plain": ["{2, 3}"]}, "execution_count": 10, "metadata": {}, "output_type": "execute_result"}], "source": ["A4 & A3"]}, {"cell_type": "code", "execution_count": 11, "metadata": {"school_cell_uuid": "a80985fe92704c6b96f7dd0b6c1cd84b"}, "outputs": [{"data": {"text/plain": ["True"]}, "execution_count": 11, "metadata": {}, "output_type": "execute_result"}], "source": ["A3.issubset(A1)"]}, {"cell_type": "code", "execution_count": 12, "metadata": {"school_cell_uuid": "d9f626d0341b4daea96ab5a208cb658d"}, "outputs": [{"data": {"text/plain": ["True"]}, "execution_count": 12, "metadata": {}, "output_type": "execute_result"}], "source": ["A3 <= A1"]}, {"cell_type": "code", "execution_count": 13, "metadata": {"school_cell_uuid": "fd35c4c4820245d2992766a050c32663"}, "outputs": [{"data": {"text/plain": ["False"]}, "execution_count": 13, "metadata": {}, "output_type": "execute_result"}], "source": ["A3.issubset(A2)"]}, {"cell_type": "code", "execution_count": 14, "metadata": {"school_cell_uuid": "dbfdb81c58f5411eb51dcb7df60f5146"}, "outputs": [{"data": {"text/plain": ["False"]}, "execution_count": 14, "metadata": {}, "output_type": "execute_result"}], "source": ["A3 <= A2"]}, {"cell_type": "code", "execution_count": 15, "metadata": {"school_cell_uuid": "3ebbb968c445424d9265062afa1e9f64"}, "outputs": [{"data": {"text/plain": ["True"]}, "execution_count": 15, "metadata": {}, "output_type": "execute_result"}], "source": ["A3 <= A3 # \ubaa8\ub4e0 \uc9d1\ud569\uc740 \uc790\uae30 \uc790\uc2e0\uc758 \ubd80\ubd84\uc9d1\ud569\uc774\ub2e4."]}, {"cell_type": "code", "execution_count": 16, "metadata": {"school_cell_uuid": "14467aa481634d4b81d16186a890f31d"}, "outputs": [{"data": {"text/plain": ["False"]}, "execution_count": 16, "metadata": {}, "output_type": "execute_result"}], "source": ["A3 < A3 # \ubaa8\ub4e0 \uc9d1\ud569\uc740 \uc790\uae30 \uc790\uc2e0\uc758 \uc9c4\ubd80\ubd84\uc9d1\ud569\uc774 \uc544\ub2c8\ub2e4."]}, {"cell_type": "code", "execution_count": 17, "metadata": {"school_cell_uuid": "5fd32412778445fda967e442e5120978"}, "outputs": [{"data": {"text/plain": ["{1, 3}"]}, "execution_count": 17, "metadata": {}, "output_type": "execute_result"}], "source": ["A1.difference(A2)"]}, {"cell_type": "code", "execution_count": 18, "metadata": {"school_cell_uuid": "a90ae07c889a481182d49b59403ab842"}, "outputs": [{"data": {"text/plain": ["{1, 3}"]}, "execution_count": 18, "metadata": {}, "output_type": "execute_result"}], "source": ["A1 - A2"]}, {"cell_type": "code", "execution_count": 19, "metadata": {"school_cell_uuid": "d863d486a96e4ec3b14c23492670b9d3"}, "outputs": [{"data": {"text/plain": ["set()"]}, "execution_count": 19, "metadata": {}, "output_type": "execute_result"}], "source": ["empty_set = set([])\n", "empty_set"]}, {"cell_type": "code", "execution_count": 20, "metadata": {"school_cell_uuid": "a3fe4dc847c94568957b02a148d1a959"}, "outputs": [{"data": {"text/plain": ["True"]}, "execution_count": 20, "metadata": {}, "output_type": "execute_result"}], "source": ["empty_set < A1"]}, {"cell_type": "code", "execution_count": 21, "metadata": {"school_cell_uuid": "663b340d2d174b9aa2500526ad6f938d"}, "outputs": [{"data": {"text/plain": ["set()"]}, "execution_count": 21, "metadata": {}, "output_type": "execute_result"}], "source": ["empty_set.intersection(A1)"]}, {"cell_type": "code", "execution_count": 22, "metadata": {"school_cell_uuid": "6731e9bfd0694b41b8765994c55186a5"}, "outputs": [{"data": {"text/plain": ["{1, 2, 3, 4}"]}, "execution_count": 22, "metadata": {}, "output_type": "execute_result"}], "source": ["empty_set.union(A1)"]}], "metadata": {"celltoolbar": "Edit Metadata", "kernelspec": {"display_name": "Python 3", "language": "python", "name": "python3"}, "language_info": {"codemirror_mode": {"name": "ipython", "version": 3}, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.0"}, "pycharm": {"stem_cell": {"cell_type": "raw", "metadata": {"collapsed": false}, "source": []}}, "toc": {"base_numbering": 1, "nav_menu": {}, "number_sections": false, "sideBar": true, "skip_h1_title": false, "title_cell": "Table of Contents", "title_sidebar": "Contents", "toc_cell": false, "toc_position": {}, "toc_section_display": true, "toc_window_display": false}}, "nbformat": 4, "nbformat_minor": 4}