From d3c5e22e1a2ba5c9d509d652dd0e4203cbb587ec Mon Sep 17 00:00:00 2001 From: Beppe Date: Thu, 21 Feb 2019 20:35:24 +0100 Subject: [PATCH] fuck --- 1/Labo1.ipynb | 48 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 12 deletions(-) diff --git a/1/Labo1.ipynb b/1/Labo1.ipynb index 2e6c50f..05c8b9d 100644 --- a/1/Labo1.ipynb +++ b/1/Labo1.ipynb @@ -185,7 +185,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 3, "metadata": {}, "outputs": [ { @@ -193,7 +193,13 @@ "output_type": "stream", "text": [ "gent\n", - "['o', 'o']\n" + "['o', 'o']\n", + "{'d', 'r', 'o', 'b'}\n", + "{'d', 'e', 'n', 'b'}\n", + "{'d', 'b', 'n', 'e', 'item naar keuze'}\n", + "zit erin\n", + "{'b', 'd'}\n", + "{'d', 'b', 'r', 'n', 'o', 'e', 'item naar keuze'}\n" ] } ], @@ -220,22 +226,40 @@ "print(klinkers(l1))\n", "\n", "\n", + "set1 = set(l1)\n", + "set2 = set(l2)\n", "\n", - "#is dit wa ge van mij verwacht?\n", - "l3 = l1+l2\n", - "print(l3)\n", + "print(set1)\n", + "print(set2)\n", + "\n", + "set2.add('item naar keuze')\n", + "\n", + "print(set2)\n", "\n", "\n", - "l3.append('item naar keuze')\n", - "\n", - "\n", - "if 'r' in l3:\n", - " print('zit erin')\n", + "if 'r' in set2 or 'r' in set1:\n", + " print('r zit erin')\n", "else:\n", - " print('zit er niet in')\n", + " print('r zit er niet in')\n", "\n", + " \n", " \n", - " \n", + "def doorsnede(klein, groot):\n", + " final = set()\n", + " for i in klein:\n", + " if i in groot:\n", + " final.add(i)\n", + " return final\n", + "\n", + "def unie(een, twee):\n", + " final = een.copy()\n", + " final.update(twee)\n", + " return final\n", + "\n", + "print(doorsnede(set1,set2))\n", + "print(unie(set1,set2))\n", + "\n", + "\n", "\n", "\n", "\n",