From 9904f5400f544389cf0aba0302993be017f950c5 Mon Sep 17 00:00:00 2001 From: Jose Windows Date: Thu, 25 Jun 2020 09:06:44 -0700 Subject: [PATCH] adding emails --- ...ilestone-2-Warmup-Project-checkpoint.ipynb | 528 ++++++++++++++---- .../00-Milestone-2-Warmup-Project.ipynb | 528 ++++++++++++++---- .../02-Exercise-Ideas-checkpoint.ipynb | 48 ++ .../00-Overview-of-Sending-Emails.ipynb | 359 ++++++++++++ .../01-Overview-of-Received-Emails.ipynb | 517 +++++++++++++++++ .../02-Exercise-Ideas.ipynb | 48 ++ ...01-Final Capstone Project-checkpoint.ipynb | 0 ...al Capstone Project Ideas-checkpoint.ipynb | 0 .../01-Final Capstone Project.ipynb | 0 .../02-Final Capstone Project Ideas.ipynb | 0 .../Projects-Solutions/Solution Links.md | 0 .../01-Interact-checkpoint.ipynb | 0 .../02-Widget Basics-checkpoint.ipynb | 0 .../03-Widget List-checkpoint.ipynb | 0 .../04-Widget Events-checkpoint.ipynb | 0 .../05-Widget Styling-checkpoint.ipynb | 0 .../06-Custom Widget-checkpoint.ipynb | 0 .../07-Advanced Widget List-checkpoint.ipynb | 0 ...idget Styling with Layout-checkpoint.ipynb | 0 .../01-Interact.ipynb | 0 .../02-Widget Basics.ipynb | 0 .../03-Widget List.ipynb | 0 .../04-Widget Events.ipynb | 0 .../05-Widget Styling.ipynb | 0 .../06-Custom Widget.ipynb | 0 .../07-Advanced Widget List.ipynb | 0 ...-Advanced Widget Styling with Layout.ipynb | 0 27 files changed, 1834 insertions(+), 194 deletions(-) create mode 100644 16-Emailing-with-Python/.ipynb_checkpoints/02-Exercise-Ideas-checkpoint.ipynb create mode 100644 16-Emailing-with-Python/00-Overview-of-Sending-Emails.ipynb create mode 100644 16-Emailing-with-Python/01-Overview-of-Received-Emails.ipynb create mode 100644 16-Emailing-with-Python/02-Exercise-Ideas.ipynb rename {16-Milestone Project - 3 => 18-Milestone Project - 3}/.ipynb_checkpoints/01-Final Capstone Project-checkpoint.ipynb (100%) rename {16-Milestone Project - 3 => 18-Milestone Project - 3}/.ipynb_checkpoints/02-Final Capstone Project Ideas-checkpoint.ipynb (100%) rename {16-Milestone Project - 3 => 18-Milestone Project - 3}/01-Final Capstone Project.ipynb (100%) rename {16-Milestone Project - 3 => 18-Milestone Project - 3}/02-Final Capstone Project Ideas.ipynb (100%) rename {16-Milestone Project - 3 => 18-Milestone Project - 3}/Projects-Solutions/Solution Links.md (100%) rename {18-Bonus Material - Introduction to GUIs => 19-Bonus Material - Introduction to GUIs}/.ipynb_checkpoints/01-Interact-checkpoint.ipynb (100%) rename {18-Bonus Material - Introduction to GUIs => 19-Bonus Material - Introduction to GUIs}/.ipynb_checkpoints/02-Widget Basics-checkpoint.ipynb (100%) rename {18-Bonus Material - Introduction to GUIs => 19-Bonus Material - Introduction to GUIs}/.ipynb_checkpoints/03-Widget List-checkpoint.ipynb (100%) rename {18-Bonus Material - Introduction to GUIs => 19-Bonus Material - Introduction to GUIs}/.ipynb_checkpoints/04-Widget Events-checkpoint.ipynb (100%) rename {18-Bonus Material - Introduction to GUIs => 19-Bonus Material - Introduction to GUIs}/.ipynb_checkpoints/05-Widget Styling-checkpoint.ipynb (100%) rename {18-Bonus Material - Introduction to GUIs => 19-Bonus Material - Introduction to GUIs}/.ipynb_checkpoints/06-Custom Widget-checkpoint.ipynb (100%) rename {18-Bonus Material - Introduction to GUIs => 19-Bonus Material - Introduction to GUIs}/.ipynb_checkpoints/07-Advanced Widget List-checkpoint.ipynb (100%) rename {18-Bonus Material - Introduction to GUIs => 19-Bonus Material - Introduction to GUIs}/.ipynb_checkpoints/08-Advanced Widget Styling with Layout-checkpoint.ipynb (100%) rename {18-Bonus Material - Introduction to GUIs => 19-Bonus Material - Introduction to GUIs}/01-Interact.ipynb (100%) rename {18-Bonus Material - Introduction to GUIs => 19-Bonus Material - Introduction to GUIs}/02-Widget Basics.ipynb (100%) rename {18-Bonus Material - Introduction to GUIs => 19-Bonus Material - Introduction to GUIs}/03-Widget List.ipynb (100%) rename {18-Bonus Material - Introduction to GUIs => 19-Bonus Material - Introduction to GUIs}/04-Widget Events.ipynb (100%) rename {18-Bonus Material - Introduction to GUIs => 19-Bonus Material - Introduction to GUIs}/05-Widget Styling.ipynb (100%) rename {18-Bonus Material - Introduction to GUIs => 19-Bonus Material - Introduction to GUIs}/06-Custom Widget.ipynb (100%) rename {18-Bonus Material - Introduction to GUIs => 19-Bonus Material - Introduction to GUIs}/07-Advanced Widget List.ipynb (100%) rename {18-Bonus Material - Introduction to GUIs => 19-Bonus Material - Introduction to GUIs}/08-Advanced Widget Styling with Layout.ipynb (100%) diff --git a/08-Milestone Project - 2/.ipynb_checkpoints/00-Milestone-2-Warmup-Project-checkpoint.ipynb b/08-Milestone Project - 2/.ipynb_checkpoints/00-Milestone-2-Warmup-Project-checkpoint.ipynb index 7b7af2bd5..5c64f393f 100644 --- a/08-Milestone Project - 2/.ipynb_checkpoints/00-Milestone-2-Warmup-Project-checkpoint.ipynb +++ b/08-Milestone Project - 2/.ipynb_checkpoints/00-Milestone-2-Warmup-Project-checkpoint.ipynb @@ -31,7 +31,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 2, "metadata": { "collapsed": true }, @@ -43,7 +43,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 3, "metadata": { "collapsed": true }, @@ -52,12 +52,12 @@ "suits = ('Hearts', 'Diamonds', 'Spades', 'Clubs')\n", "ranks = ('Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten', 'Jack', 'Queen', 'King', 'Ace')\n", "values = {'Two':2, 'Three':3, 'Four':4, 'Five':5, 'Six':6, 'Seven':7, 'Eight':8, \n", - " 'Nine':9, 'Ten':10, 'Jack':10, 'Queen':10, 'King':10, 'Ace':11}" + " 'Nine':9, 'Ten':10, 'Jack':11, 'Queen':12, 'King':13, 'Ace':14}" ] }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "metadata": { "collapsed": true }, @@ -83,7 +83,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -92,7 +92,7 @@ "'Hearts'" ] }, - "execution_count": 4, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -103,7 +103,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 6, "metadata": {}, "outputs": [ { @@ -112,7 +112,7 @@ "'Two'" ] }, - "execution_count": 5, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } @@ -123,7 +123,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 7, "metadata": { "collapsed": true }, @@ -134,16 +134,16 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "<__main__.Card at 0x1c923beeb38>" + "<__main__.Card at 0x1dfaff6b898>" ] }, - "execution_count": 7, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } @@ -154,7 +154,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 9, "metadata": {}, "outputs": [ { @@ -171,7 +171,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 10, "metadata": {}, "outputs": [ { @@ -180,7 +180,7 @@ "'Two'" ] }, - "execution_count": 9, + "execution_count": 10, "metadata": {}, "output_type": "execute_result" } @@ -191,7 +191,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 11, "metadata": {}, "outputs": [ { @@ -200,7 +200,7 @@ "2" ] }, - "execution_count": 10, + "execution_count": 11, "metadata": {}, "output_type": "execute_result" } @@ -211,7 +211,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 12, "metadata": {}, "outputs": [ { @@ -220,7 +220,7 @@ "2" ] }, - "execution_count": 11, + "execution_count": 12, "metadata": {}, "output_type": "execute_result" } @@ -249,7 +249,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 13, "metadata": { "collapsed": true }, @@ -283,7 +283,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 14, "metadata": { "collapsed": true }, @@ -294,7 +294,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 15, "metadata": {}, "outputs": [ { @@ -303,7 +303,7 @@ "52" ] }, - "execution_count": 14, + "execution_count": 15, "metadata": {}, "output_type": "execute_result" } @@ -314,16 +314,16 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 16, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "<__main__.Card at 0x1c923bfeda0>" + "<__main__.Card at 0x1dfaff269e8>" ] }, - "execution_count": 15, + "execution_count": 16, "metadata": {}, "output_type": "execute_result" } @@ -334,7 +334,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 17, "metadata": {}, "outputs": [ { @@ -351,7 +351,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 18, "metadata": { "collapsed": true }, @@ -362,14 +362,14 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 19, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Seven of Spades\n" + "Five of Spades\n" ] } ], @@ -379,7 +379,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 20, "metadata": { "collapsed": true }, @@ -390,14 +390,14 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 21, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "King of Hearts\n" + "King of Clubs\n" ] } ], @@ -425,7 +425,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 22, "metadata": { "collapsed": true }, @@ -457,7 +457,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 23, "metadata": { "collapsed": true }, @@ -468,16 +468,16 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 24, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "<__main__.Player at 0x1c923bfe400>" + "<__main__.Player at 0x1dfaff8b940>" ] }, - "execution_count": 23, + "execution_count": 24, "metadata": {}, "output_type": "execute_result" } @@ -488,7 +488,7 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": 25, "metadata": {}, "outputs": [ { @@ -505,16 +505,16 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 26, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "<__main__.Card at 0x1c923beeb38>" + "<__main__.Card at 0x1dfaff6b898>" ] }, - "execution_count": 25, + "execution_count": 26, "metadata": {}, "output_type": "execute_result" } @@ -525,7 +525,7 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 27, "metadata": { "collapsed": true }, @@ -536,7 +536,7 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": 28, "metadata": {}, "outputs": [ { @@ -553,7 +553,7 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": 29, "metadata": { "collapsed": true }, @@ -564,7 +564,7 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": 30, "metadata": {}, "outputs": [ { @@ -588,7 +588,7 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": 31, "metadata": { "collapsed": true }, @@ -599,7 +599,7 @@ }, { "cell_type": "code", - "execution_count": 31, + "execution_count": 32, "metadata": { "collapsed": true }, @@ -617,7 +617,7 @@ }, { "cell_type": "code", - "execution_count": 32, + "execution_count": 33, "metadata": { "collapsed": true }, @@ -628,7 +628,7 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": 34, "metadata": { "collapsed": true }, @@ -646,7 +646,7 @@ }, { "cell_type": "code", - "execution_count": 34, + "execution_count": 35, "metadata": {}, "outputs": [ { @@ -655,7 +655,7 @@ "26.0" ] }, - "execution_count": 34, + "execution_count": 35, "metadata": {}, "output_type": "execute_result" } @@ -666,7 +666,7 @@ }, { "cell_type": "code", - "execution_count": 35, + "execution_count": 36, "metadata": { "collapsed": true }, @@ -679,7 +679,7 @@ }, { "cell_type": "code", - "execution_count": 36, + "execution_count": 37, "metadata": {}, "outputs": [ { @@ -688,7 +688,7 @@ "0" ] }, - "execution_count": 36, + "execution_count": 37, "metadata": {}, "output_type": "execute_result" } @@ -699,7 +699,7 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": 38, "metadata": {}, "outputs": [ { @@ -708,7 +708,7 @@ "26" ] }, - "execution_count": 37, + "execution_count": 38, "metadata": {}, "output_type": "execute_result" } @@ -719,7 +719,7 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": 39, "metadata": {}, "outputs": [ { @@ -728,7 +728,7 @@ "26" ] }, - "execution_count": 38, + "execution_count": 39, "metadata": {}, "output_type": "execute_result" } @@ -746,7 +746,7 @@ }, { "cell_type": "code", - "execution_count": 365, + "execution_count": 40, "metadata": { "collapsed": true }, @@ -757,7 +757,7 @@ }, { "cell_type": "code", - "execution_count": 366, + "execution_count": 41, "metadata": { "collapsed": true }, @@ -768,7 +768,7 @@ }, { "cell_type": "code", - "execution_count": 367, + "execution_count": 42, "metadata": {}, "outputs": [ { @@ -783,7 +783,6 @@ "Round 6\n", "Round 7\n", "Round 8\n", - "WAR!\n", "Round 9\n", "Round 10\n", "Round 11\n", @@ -791,10 +790,7 @@ "Round 13\n", "Round 14\n", "Round 15\n", - "WAR!\n", - "WAR!\n", "Round 16\n", - "WAR!\n", "Round 17\n", "Round 18\n", "Round 19\n", @@ -802,6 +798,10 @@ "Round 21\n", "Round 22\n", "Round 23\n", + "Round 24\n", + "Round 25\n", + "Round 26\n", + "Round 27\n", "Player One out of cards! Game Over\n" ] } @@ -816,10 +816,14 @@ " # Check to see if a player is out of cards:\n", " if len(player_one.all_cards) == 0:\n", " print(\"Player One out of cards! Game Over\")\n", + " print(\"Player Two Wins!\")\n", + " game_on = False\n", " break\n", " \n", " if len(player_two.all_cards) == 0:\n", " print(\"Player Two out of cards! Game Over\")\n", + " print(\"Player One Wins!\")\n", + " game_on = False\n", " break\n", " \n", " # Otherwise, the game is still on!\n", @@ -832,17 +836,15 @@ " player_two_cards.append(player_two.remove_one())\n", " \n", " at_war = True\n", - " \n", + "\n", " while at_war:\n", - " \n", - " # Compare the Cards\n", - "# pdb.set_trace()\n", + "\n", "\n", " if player_one_cards[-1].value > player_two_cards[-1].value:\n", "\n", " # Player One gets the cards\n", - " player_two.add_cards(player_one_cards)\n", - " player_two.add_cards(player_two_cards)\n", + " player_one.add_cards(player_one_cards)\n", + " player_one.add_cards(player_two_cards)\n", " \n", " \n", " # No Longer at \"war\" , time for next round\n", @@ -866,19 +868,22 @@ " # First check to see if player has enough cards\n", " \n", " # Check to see if a player is out of cards:\n", - " if len(player_one.all_cards) == 0:\n", - " print(\"Player One out of cards! Game Over at War\")\n", + " if len(player_one.all_cards) < 5:\n", + " print(\"Player One unable to play war! Game Over at War\")\n", + " print(\"Player Two Wins! Player One Loses!\")\n", + " game_on = False\n", " break\n", "\n", - " if len(player_two.all_cards) == 0:\n", - " print(\"Player Two out of cards! Game Over at War\")\n", + " elif len(player_two.all_cards) < 5:\n", + " print(\"Player Two unable to play war! Game Over at War\")\n", + " print(\"Player One Wins! Player One Loses!\")\n", + " game_on = False\n", " break\n", - " \n", " # Otherwise, we're still at war, so we'll add the next cards\n", - " \n", - " player_one_cards.append(player_one.remove_one())\n", - " player_two_cards.append(player_two.remove_one())\n", - " \n", + " else:\n", + " for num in range(5):\n", + " player_one_cards.append(player_one.remove_one())\n", + " player_two_cards.append(player_two.remove_one())\n", " " ] }, @@ -891,10 +896,8 @@ }, { "cell_type": "code", - "execution_count": 70, - "metadata": { - "collapsed": true - }, + "execution_count": 62, + "metadata": {}, "outputs": [], "source": [ "player_one = Player(\"One\")\n", @@ -912,7 +915,7 @@ }, { "cell_type": "code", - "execution_count": 71, + "execution_count": 63, "metadata": {}, "outputs": [ { @@ -921,8 +924,12 @@ "text": [ "Round 1\n", "Round 2\n", + "WAR!\n", "Round 3\n", + "WAR!\n", + "WAR!\n", "Round 4\n", + "WAR!\n", "Round 5\n", "Round 6\n", "Round 7\n", @@ -930,11 +937,12 @@ "Round 9\n", "Round 10\n", "Round 11\n", - "WAR!\n", "Round 12\n", "Round 13\n", + "WAR!\n", "Round 14\n", "Round 15\n", + "WAR!\n", "Round 16\n", "Round 17\n", "Round 18\n", @@ -949,26 +957,25 @@ "Round 27\n", "Round 28\n", "Round 29\n", + "WAR!\n", "Round 30\n", "Round 31\n", "Round 32\n", "WAR!\n", - "WAR!\n", "Round 33\n", "Round 34\n", "Round 35\n", "Round 36\n", "Round 37\n", "Round 38\n", - "WAR!\n", "Round 39\n", "Round 40\n", "Round 41\n", "Round 42\n", - "Round 43\n", "WAR!\n", - "Round 44\n", "WAR!\n", + "Round 43\n", + "Round 44\n", "Round 45\n", "Round 46\n", "Round 47\n", @@ -976,12 +983,10 @@ "Round 49\n", "Round 50\n", "Round 51\n", - "WAR!\n", "Round 52\n", "Round 53\n", "Round 54\n", "Round 55\n", - "WAR!\n", "Round 56\n", "Round 57\n", "Round 58\n", @@ -1025,12 +1030,267 @@ "Round 96\n", "Round 97\n", "Round 98\n", - "WAR!\n", "Round 99\n", "Round 100\n", "Round 101\n", "Round 102\n", "Round 103\n", + "Round 104\n", + "Round 105\n", + "Round 106\n", + "Round 107\n", + "Round 108\n", + "WAR!\n", + "Round 109\n", + "Round 110\n", + "Round 111\n", + "Round 112\n", + "Round 113\n", + "Round 114\n", + "Round 115\n", + "Round 116\n", + "Round 117\n", + "Round 118\n", + "Round 119\n", + "Round 120\n", + "Round 121\n", + "Round 122\n", + "Round 123\n", + "Round 124\n", + "Round 125\n", + "Round 126\n", + "Round 127\n", + "Round 128\n", + "Round 129\n", + "Round 130\n", + "Round 131\n", + "Round 132\n", + "Round 133\n", + "Round 134\n", + "WAR!\n", + "Round 135\n", + "Round 136\n", + "WAR!\n", + "Round 137\n", + "WAR!\n", + "Round 138\n", + "Round 139\n", + "Round 140\n", + "Round 141\n", + "Round 142\n", + "Round 143\n", + "Round 144\n", + "Round 145\n", + "Round 146\n", + "Round 147\n", + "Round 148\n", + "Round 149\n", + "Round 150\n", + "Round 151\n", + "Round 152\n", + "Round 153\n", + "Round 154\n", + "Round 155\n", + "Round 156\n", + "Round 157\n", + "Round 158\n", + "Round 159\n", + "Round 160\n", + "Round 161\n", + "Round 162\n", + "Round 163\n", + "Round 164\n", + "Round 165\n", + "Round 166\n", + "Round 167\n", + "Round 168\n", + "Round 169\n", + "Round 170\n", + "Round 171\n", + "Round 172\n", + "Round 173\n", + "Round 174\n", + "Round 175\n", + "Round 176\n", + "Round 177\n", + "Round 178\n", + "Round 179\n", + "Round 180\n", + "Round 181\n", + "Round 182\n", + "Round 183\n", + "Round 184\n", + "Round 185\n", + "Round 186\n", + "Round 187\n", + "Round 188\n", + "Round 189\n", + "Round 190\n", + "Round 191\n", + "Round 192\n", + "Round 193\n", + "Round 194\n", + "Round 195\n", + "Round 196\n", + "Round 197\n", + "Round 198\n", + "Round 199\n", + "Round 200\n", + "Round 201\n", + "Round 202\n", + "Round 203\n", + "Round 204\n", + "Round 205\n", + "Round 206\n", + "Round 207\n", + "Round 208\n", + "Round 209\n", + "Round 210\n", + "Round 211\n", + "Round 212\n", + "Round 213\n", + "Round 214\n", + "Round 215\n", + "Round 216\n", + "Round 217\n", + "Round 218\n", + "Round 219\n", + "Round 220\n", + "Round 221\n", + "Round 222\n", + "Round 223\n", + "WAR!\n", + "Round 224\n", + "Round 225\n", + "Round 226\n", + "Round 227\n", + "Round 228\n", + "Round 229\n", + "Round 230\n", + "Round 231\n", + "Round 232\n", + "Round 233\n", + "Round 234\n", + "Round 235\n", + "Round 236\n", + "Round 237\n", + "Round 238\n", + "Round 239\n", + "Round 240\n", + "Round 241\n", + "Round 242\n", + "Round 243\n", + "Round 244\n", + "Round 245\n", + "Round 246\n", + "Round 247\n", + "Round 248\n", + "Round 249\n", + "Round 250\n", + "Round 251\n", + "Round 252\n", + "Round 253\n", + "Round 254\n", + "Round 255\n", + "Round 256\n", + "Round 257\n", + "WAR!\n", + "Round 258\n", + "Round 259\n", + "Round 260\n", + "Round 261\n", + "Round 262\n", + "Round 263\n", + "Round 264\n", + "Round 265\n", + "Round 266\n", + "Round 267\n", + "Round 268\n", + "Round 269\n", + "Round 270\n", + "Round 271\n", + "Round 272\n", + "Round 273\n", + "Round 274\n", + "Round 275\n", + "Round 276\n", + "Round 277\n", + "Round 278\n", + "Round 279\n", + "Round 280\n", + "Round 281\n", + "Round 282\n", + "Round 283\n", + "Round 284\n", + "Round 285\n", + "Round 286\n", + "Round 287\n", + "Round 288\n", + "Round 289\n", + "Round 290\n", + "Round 291\n", + "Round 292\n", + "Round 293\n", + "Round 294\n", + "Round 295\n", + "Round 296\n", + "Round 297\n", + "Round 298\n", + "Round 299\n", + "Round 300\n", + "Round 301\n", + "Round 302\n", + "Round 303\n", + "Round 304\n", + "Round 305\n", + "Round 306\n", + "Round 307\n", + "WAR!\n", + "Round 308\n", + "Round 309\n", + "Round 310\n", + "Round 311\n", + "Round 312\n", + "Round 313\n", + "Round 314\n", + "Round 315\n", + "WAR!\n", + "Round 316\n", + "Round 317\n", + "Round 318\n", + "Round 319\n", + "Round 320\n", + "Round 321\n", + "Round 322\n", + "Round 323\n", + "Round 324\n", + "Round 325\n", + "Round 326\n", + "Round 327\n", + "Round 328\n", + "Round 329\n", + "Round 330\n", + "Round 331\n", + "Round 332\n", + "Round 333\n", + "Round 334\n", + "Round 335\n", + "Round 336\n", + "Round 337\n", + "Round 338\n", + "Round 339\n", + "Round 340\n", + "Round 341\n", + "Round 342\n", + "Round 343\n", + "Round 344\n", + "Round 345\n", + "Round 346\n", + "Round 347\n", + "Round 348\n", + "Round 349\n", + "WAR!\n", + "Round 350\n", "WAR!\n", "Player Two unable to play war! Game Over at War\n", "Player One Wins! Player One Loses!\n" @@ -1099,26 +1359,100 @@ " # First check to see if player has enough cards\n", " \n", " # Check to see if a player is out of cards:\n", - " if len(player_one.all_cards) < 3:\n", + " if len(player_one.all_cards) < 5:\n", " print(\"Player One unable to play war! Game Over at War\")\n", " print(\"Player Two Wins! Player One Loses!\")\n", " game_on = False\n", " break\n", "\n", - " elif len(player_two.all_cards) < 3:\n", + " elif len(player_two.all_cards) < 5:\n", " print(\"Player Two unable to play war! Game Over at War\")\n", " print(\"Player One Wins! Player One Loses!\")\n", " game_on = False\n", " break\n", " # Otherwise, we're still at war, so we'll add the next cards\n", " else:\n", - " for num in range(3):\n", + " for num in range(5):\n", " player_one_cards.append(player_one.remove_one())\n", " player_two_cards.append(player_two.remove_one())\n", "\n", " " ] }, + { + "cell_type": "code", + "execution_count": 56, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "27" + ] + }, + "execution_count": 56, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(player_one.all_cards)" + ] + }, + { + "cell_type": "code", + "execution_count": 57, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "25" + ] + }, + "execution_count": 57, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(player_two.all_cards)" + ] + }, + { + "cell_type": "code", + "execution_count": 59, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ace of Diamonds\n" + ] + } + ], + "source": [ + "print(player_one_cards[-1])" + ] + }, + { + "cell_type": "code", + "execution_count": 60, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Four of Hearts\n" + ] + } + ], + "source": [ + "print(player_two_cards[-1])" + ] + }, { "cell_type": "markdown", "metadata": { diff --git a/08-Milestone Project - 2/00-Milestone-2-Warmup-Project.ipynb b/08-Milestone Project - 2/00-Milestone-2-Warmup-Project.ipynb index 7b7af2bd5..5c64f393f 100644 --- a/08-Milestone Project - 2/00-Milestone-2-Warmup-Project.ipynb +++ b/08-Milestone Project - 2/00-Milestone-2-Warmup-Project.ipynb @@ -31,7 +31,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 2, "metadata": { "collapsed": true }, @@ -43,7 +43,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 3, "metadata": { "collapsed": true }, @@ -52,12 +52,12 @@ "suits = ('Hearts', 'Diamonds', 'Spades', 'Clubs')\n", "ranks = ('Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten', 'Jack', 'Queen', 'King', 'Ace')\n", "values = {'Two':2, 'Three':3, 'Four':4, 'Five':5, 'Six':6, 'Seven':7, 'Eight':8, \n", - " 'Nine':9, 'Ten':10, 'Jack':10, 'Queen':10, 'King':10, 'Ace':11}" + " 'Nine':9, 'Ten':10, 'Jack':11, 'Queen':12, 'King':13, 'Ace':14}" ] }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "metadata": { "collapsed": true }, @@ -83,7 +83,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -92,7 +92,7 @@ "'Hearts'" ] }, - "execution_count": 4, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -103,7 +103,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 6, "metadata": {}, "outputs": [ { @@ -112,7 +112,7 @@ "'Two'" ] }, - "execution_count": 5, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } @@ -123,7 +123,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 7, "metadata": { "collapsed": true }, @@ -134,16 +134,16 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "<__main__.Card at 0x1c923beeb38>" + "<__main__.Card at 0x1dfaff6b898>" ] }, - "execution_count": 7, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } @@ -154,7 +154,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 9, "metadata": {}, "outputs": [ { @@ -171,7 +171,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 10, "metadata": {}, "outputs": [ { @@ -180,7 +180,7 @@ "'Two'" ] }, - "execution_count": 9, + "execution_count": 10, "metadata": {}, "output_type": "execute_result" } @@ -191,7 +191,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 11, "metadata": {}, "outputs": [ { @@ -200,7 +200,7 @@ "2" ] }, - "execution_count": 10, + "execution_count": 11, "metadata": {}, "output_type": "execute_result" } @@ -211,7 +211,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 12, "metadata": {}, "outputs": [ { @@ -220,7 +220,7 @@ "2" ] }, - "execution_count": 11, + "execution_count": 12, "metadata": {}, "output_type": "execute_result" } @@ -249,7 +249,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 13, "metadata": { "collapsed": true }, @@ -283,7 +283,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 14, "metadata": { "collapsed": true }, @@ -294,7 +294,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 15, "metadata": {}, "outputs": [ { @@ -303,7 +303,7 @@ "52" ] }, - "execution_count": 14, + "execution_count": 15, "metadata": {}, "output_type": "execute_result" } @@ -314,16 +314,16 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 16, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "<__main__.Card at 0x1c923bfeda0>" + "<__main__.Card at 0x1dfaff269e8>" ] }, - "execution_count": 15, + "execution_count": 16, "metadata": {}, "output_type": "execute_result" } @@ -334,7 +334,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 17, "metadata": {}, "outputs": [ { @@ -351,7 +351,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 18, "metadata": { "collapsed": true }, @@ -362,14 +362,14 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 19, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Seven of Spades\n" + "Five of Spades\n" ] } ], @@ -379,7 +379,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 20, "metadata": { "collapsed": true }, @@ -390,14 +390,14 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 21, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "King of Hearts\n" + "King of Clubs\n" ] } ], @@ -425,7 +425,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 22, "metadata": { "collapsed": true }, @@ -457,7 +457,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 23, "metadata": { "collapsed": true }, @@ -468,16 +468,16 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 24, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "<__main__.Player at 0x1c923bfe400>" + "<__main__.Player at 0x1dfaff8b940>" ] }, - "execution_count": 23, + "execution_count": 24, "metadata": {}, "output_type": "execute_result" } @@ -488,7 +488,7 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": 25, "metadata": {}, "outputs": [ { @@ -505,16 +505,16 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 26, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "<__main__.Card at 0x1c923beeb38>" + "<__main__.Card at 0x1dfaff6b898>" ] }, - "execution_count": 25, + "execution_count": 26, "metadata": {}, "output_type": "execute_result" } @@ -525,7 +525,7 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 27, "metadata": { "collapsed": true }, @@ -536,7 +536,7 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": 28, "metadata": {}, "outputs": [ { @@ -553,7 +553,7 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": 29, "metadata": { "collapsed": true }, @@ -564,7 +564,7 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": 30, "metadata": {}, "outputs": [ { @@ -588,7 +588,7 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": 31, "metadata": { "collapsed": true }, @@ -599,7 +599,7 @@ }, { "cell_type": "code", - "execution_count": 31, + "execution_count": 32, "metadata": { "collapsed": true }, @@ -617,7 +617,7 @@ }, { "cell_type": "code", - "execution_count": 32, + "execution_count": 33, "metadata": { "collapsed": true }, @@ -628,7 +628,7 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": 34, "metadata": { "collapsed": true }, @@ -646,7 +646,7 @@ }, { "cell_type": "code", - "execution_count": 34, + "execution_count": 35, "metadata": {}, "outputs": [ { @@ -655,7 +655,7 @@ "26.0" ] }, - "execution_count": 34, + "execution_count": 35, "metadata": {}, "output_type": "execute_result" } @@ -666,7 +666,7 @@ }, { "cell_type": "code", - "execution_count": 35, + "execution_count": 36, "metadata": { "collapsed": true }, @@ -679,7 +679,7 @@ }, { "cell_type": "code", - "execution_count": 36, + "execution_count": 37, "metadata": {}, "outputs": [ { @@ -688,7 +688,7 @@ "0" ] }, - "execution_count": 36, + "execution_count": 37, "metadata": {}, "output_type": "execute_result" } @@ -699,7 +699,7 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": 38, "metadata": {}, "outputs": [ { @@ -708,7 +708,7 @@ "26" ] }, - "execution_count": 37, + "execution_count": 38, "metadata": {}, "output_type": "execute_result" } @@ -719,7 +719,7 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": 39, "metadata": {}, "outputs": [ { @@ -728,7 +728,7 @@ "26" ] }, - "execution_count": 38, + "execution_count": 39, "metadata": {}, "output_type": "execute_result" } @@ -746,7 +746,7 @@ }, { "cell_type": "code", - "execution_count": 365, + "execution_count": 40, "metadata": { "collapsed": true }, @@ -757,7 +757,7 @@ }, { "cell_type": "code", - "execution_count": 366, + "execution_count": 41, "metadata": { "collapsed": true }, @@ -768,7 +768,7 @@ }, { "cell_type": "code", - "execution_count": 367, + "execution_count": 42, "metadata": {}, "outputs": [ { @@ -783,7 +783,6 @@ "Round 6\n", "Round 7\n", "Round 8\n", - "WAR!\n", "Round 9\n", "Round 10\n", "Round 11\n", @@ -791,10 +790,7 @@ "Round 13\n", "Round 14\n", "Round 15\n", - "WAR!\n", - "WAR!\n", "Round 16\n", - "WAR!\n", "Round 17\n", "Round 18\n", "Round 19\n", @@ -802,6 +798,10 @@ "Round 21\n", "Round 22\n", "Round 23\n", + "Round 24\n", + "Round 25\n", + "Round 26\n", + "Round 27\n", "Player One out of cards! Game Over\n" ] } @@ -816,10 +816,14 @@ " # Check to see if a player is out of cards:\n", " if len(player_one.all_cards) == 0:\n", " print(\"Player One out of cards! Game Over\")\n", + " print(\"Player Two Wins!\")\n", + " game_on = False\n", " break\n", " \n", " if len(player_two.all_cards) == 0:\n", " print(\"Player Two out of cards! Game Over\")\n", + " print(\"Player One Wins!\")\n", + " game_on = False\n", " break\n", " \n", " # Otherwise, the game is still on!\n", @@ -832,17 +836,15 @@ " player_two_cards.append(player_two.remove_one())\n", " \n", " at_war = True\n", - " \n", + "\n", " while at_war:\n", - " \n", - " # Compare the Cards\n", - "# pdb.set_trace()\n", + "\n", "\n", " if player_one_cards[-1].value > player_two_cards[-1].value:\n", "\n", " # Player One gets the cards\n", - " player_two.add_cards(player_one_cards)\n", - " player_two.add_cards(player_two_cards)\n", + " player_one.add_cards(player_one_cards)\n", + " player_one.add_cards(player_two_cards)\n", " \n", " \n", " # No Longer at \"war\" , time for next round\n", @@ -866,19 +868,22 @@ " # First check to see if player has enough cards\n", " \n", " # Check to see if a player is out of cards:\n", - " if len(player_one.all_cards) == 0:\n", - " print(\"Player One out of cards! Game Over at War\")\n", + " if len(player_one.all_cards) < 5:\n", + " print(\"Player One unable to play war! Game Over at War\")\n", + " print(\"Player Two Wins! Player One Loses!\")\n", + " game_on = False\n", " break\n", "\n", - " if len(player_two.all_cards) == 0:\n", - " print(\"Player Two out of cards! Game Over at War\")\n", + " elif len(player_two.all_cards) < 5:\n", + " print(\"Player Two unable to play war! Game Over at War\")\n", + " print(\"Player One Wins! Player One Loses!\")\n", + " game_on = False\n", " break\n", - " \n", " # Otherwise, we're still at war, so we'll add the next cards\n", - " \n", - " player_one_cards.append(player_one.remove_one())\n", - " player_two_cards.append(player_two.remove_one())\n", - " \n", + " else:\n", + " for num in range(5):\n", + " player_one_cards.append(player_one.remove_one())\n", + " player_two_cards.append(player_two.remove_one())\n", " " ] }, @@ -891,10 +896,8 @@ }, { "cell_type": "code", - "execution_count": 70, - "metadata": { - "collapsed": true - }, + "execution_count": 62, + "metadata": {}, "outputs": [], "source": [ "player_one = Player(\"One\")\n", @@ -912,7 +915,7 @@ }, { "cell_type": "code", - "execution_count": 71, + "execution_count": 63, "metadata": {}, "outputs": [ { @@ -921,8 +924,12 @@ "text": [ "Round 1\n", "Round 2\n", + "WAR!\n", "Round 3\n", + "WAR!\n", + "WAR!\n", "Round 4\n", + "WAR!\n", "Round 5\n", "Round 6\n", "Round 7\n", @@ -930,11 +937,12 @@ "Round 9\n", "Round 10\n", "Round 11\n", - "WAR!\n", "Round 12\n", "Round 13\n", + "WAR!\n", "Round 14\n", "Round 15\n", + "WAR!\n", "Round 16\n", "Round 17\n", "Round 18\n", @@ -949,26 +957,25 @@ "Round 27\n", "Round 28\n", "Round 29\n", + "WAR!\n", "Round 30\n", "Round 31\n", "Round 32\n", "WAR!\n", - "WAR!\n", "Round 33\n", "Round 34\n", "Round 35\n", "Round 36\n", "Round 37\n", "Round 38\n", - "WAR!\n", "Round 39\n", "Round 40\n", "Round 41\n", "Round 42\n", - "Round 43\n", "WAR!\n", - "Round 44\n", "WAR!\n", + "Round 43\n", + "Round 44\n", "Round 45\n", "Round 46\n", "Round 47\n", @@ -976,12 +983,10 @@ "Round 49\n", "Round 50\n", "Round 51\n", - "WAR!\n", "Round 52\n", "Round 53\n", "Round 54\n", "Round 55\n", - "WAR!\n", "Round 56\n", "Round 57\n", "Round 58\n", @@ -1025,12 +1030,267 @@ "Round 96\n", "Round 97\n", "Round 98\n", - "WAR!\n", "Round 99\n", "Round 100\n", "Round 101\n", "Round 102\n", "Round 103\n", + "Round 104\n", + "Round 105\n", + "Round 106\n", + "Round 107\n", + "Round 108\n", + "WAR!\n", + "Round 109\n", + "Round 110\n", + "Round 111\n", + "Round 112\n", + "Round 113\n", + "Round 114\n", + "Round 115\n", + "Round 116\n", + "Round 117\n", + "Round 118\n", + "Round 119\n", + "Round 120\n", + "Round 121\n", + "Round 122\n", + "Round 123\n", + "Round 124\n", + "Round 125\n", + "Round 126\n", + "Round 127\n", + "Round 128\n", + "Round 129\n", + "Round 130\n", + "Round 131\n", + "Round 132\n", + "Round 133\n", + "Round 134\n", + "WAR!\n", + "Round 135\n", + "Round 136\n", + "WAR!\n", + "Round 137\n", + "WAR!\n", + "Round 138\n", + "Round 139\n", + "Round 140\n", + "Round 141\n", + "Round 142\n", + "Round 143\n", + "Round 144\n", + "Round 145\n", + "Round 146\n", + "Round 147\n", + "Round 148\n", + "Round 149\n", + "Round 150\n", + "Round 151\n", + "Round 152\n", + "Round 153\n", + "Round 154\n", + "Round 155\n", + "Round 156\n", + "Round 157\n", + "Round 158\n", + "Round 159\n", + "Round 160\n", + "Round 161\n", + "Round 162\n", + "Round 163\n", + "Round 164\n", + "Round 165\n", + "Round 166\n", + "Round 167\n", + "Round 168\n", + "Round 169\n", + "Round 170\n", + "Round 171\n", + "Round 172\n", + "Round 173\n", + "Round 174\n", + "Round 175\n", + "Round 176\n", + "Round 177\n", + "Round 178\n", + "Round 179\n", + "Round 180\n", + "Round 181\n", + "Round 182\n", + "Round 183\n", + "Round 184\n", + "Round 185\n", + "Round 186\n", + "Round 187\n", + "Round 188\n", + "Round 189\n", + "Round 190\n", + "Round 191\n", + "Round 192\n", + "Round 193\n", + "Round 194\n", + "Round 195\n", + "Round 196\n", + "Round 197\n", + "Round 198\n", + "Round 199\n", + "Round 200\n", + "Round 201\n", + "Round 202\n", + "Round 203\n", + "Round 204\n", + "Round 205\n", + "Round 206\n", + "Round 207\n", + "Round 208\n", + "Round 209\n", + "Round 210\n", + "Round 211\n", + "Round 212\n", + "Round 213\n", + "Round 214\n", + "Round 215\n", + "Round 216\n", + "Round 217\n", + "Round 218\n", + "Round 219\n", + "Round 220\n", + "Round 221\n", + "Round 222\n", + "Round 223\n", + "WAR!\n", + "Round 224\n", + "Round 225\n", + "Round 226\n", + "Round 227\n", + "Round 228\n", + "Round 229\n", + "Round 230\n", + "Round 231\n", + "Round 232\n", + "Round 233\n", + "Round 234\n", + "Round 235\n", + "Round 236\n", + "Round 237\n", + "Round 238\n", + "Round 239\n", + "Round 240\n", + "Round 241\n", + "Round 242\n", + "Round 243\n", + "Round 244\n", + "Round 245\n", + "Round 246\n", + "Round 247\n", + "Round 248\n", + "Round 249\n", + "Round 250\n", + "Round 251\n", + "Round 252\n", + "Round 253\n", + "Round 254\n", + "Round 255\n", + "Round 256\n", + "Round 257\n", + "WAR!\n", + "Round 258\n", + "Round 259\n", + "Round 260\n", + "Round 261\n", + "Round 262\n", + "Round 263\n", + "Round 264\n", + "Round 265\n", + "Round 266\n", + "Round 267\n", + "Round 268\n", + "Round 269\n", + "Round 270\n", + "Round 271\n", + "Round 272\n", + "Round 273\n", + "Round 274\n", + "Round 275\n", + "Round 276\n", + "Round 277\n", + "Round 278\n", + "Round 279\n", + "Round 280\n", + "Round 281\n", + "Round 282\n", + "Round 283\n", + "Round 284\n", + "Round 285\n", + "Round 286\n", + "Round 287\n", + "Round 288\n", + "Round 289\n", + "Round 290\n", + "Round 291\n", + "Round 292\n", + "Round 293\n", + "Round 294\n", + "Round 295\n", + "Round 296\n", + "Round 297\n", + "Round 298\n", + "Round 299\n", + "Round 300\n", + "Round 301\n", + "Round 302\n", + "Round 303\n", + "Round 304\n", + "Round 305\n", + "Round 306\n", + "Round 307\n", + "WAR!\n", + "Round 308\n", + "Round 309\n", + "Round 310\n", + "Round 311\n", + "Round 312\n", + "Round 313\n", + "Round 314\n", + "Round 315\n", + "WAR!\n", + "Round 316\n", + "Round 317\n", + "Round 318\n", + "Round 319\n", + "Round 320\n", + "Round 321\n", + "Round 322\n", + "Round 323\n", + "Round 324\n", + "Round 325\n", + "Round 326\n", + "Round 327\n", + "Round 328\n", + "Round 329\n", + "Round 330\n", + "Round 331\n", + "Round 332\n", + "Round 333\n", + "Round 334\n", + "Round 335\n", + "Round 336\n", + "Round 337\n", + "Round 338\n", + "Round 339\n", + "Round 340\n", + "Round 341\n", + "Round 342\n", + "Round 343\n", + "Round 344\n", + "Round 345\n", + "Round 346\n", + "Round 347\n", + "Round 348\n", + "Round 349\n", + "WAR!\n", + "Round 350\n", "WAR!\n", "Player Two unable to play war! Game Over at War\n", "Player One Wins! Player One Loses!\n" @@ -1099,26 +1359,100 @@ " # First check to see if player has enough cards\n", " \n", " # Check to see if a player is out of cards:\n", - " if len(player_one.all_cards) < 3:\n", + " if len(player_one.all_cards) < 5:\n", " print(\"Player One unable to play war! Game Over at War\")\n", " print(\"Player Two Wins! Player One Loses!\")\n", " game_on = False\n", " break\n", "\n", - " elif len(player_two.all_cards) < 3:\n", + " elif len(player_two.all_cards) < 5:\n", " print(\"Player Two unable to play war! Game Over at War\")\n", " print(\"Player One Wins! Player One Loses!\")\n", " game_on = False\n", " break\n", " # Otherwise, we're still at war, so we'll add the next cards\n", " else:\n", - " for num in range(3):\n", + " for num in range(5):\n", " player_one_cards.append(player_one.remove_one())\n", " player_two_cards.append(player_two.remove_one())\n", "\n", " " ] }, + { + "cell_type": "code", + "execution_count": 56, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "27" + ] + }, + "execution_count": 56, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(player_one.all_cards)" + ] + }, + { + "cell_type": "code", + "execution_count": 57, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "25" + ] + }, + "execution_count": 57, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(player_two.all_cards)" + ] + }, + { + "cell_type": "code", + "execution_count": 59, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ace of Diamonds\n" + ] + } + ], + "source": [ + "print(player_one_cards[-1])" + ] + }, + { + "cell_type": "code", + "execution_count": 60, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Four of Hearts\n" + ] + } + ], + "source": [ + "print(player_two_cards[-1])" + ] + }, { "cell_type": "markdown", "metadata": { diff --git a/16-Emailing-with-Python/.ipynb_checkpoints/02-Exercise-Ideas-checkpoint.ipynb b/16-Emailing-with-Python/.ipynb_checkpoints/02-Exercise-Ideas-checkpoint.ipynb new file mode 100644 index 000000000..0f7d6c49e --- /dev/null +++ b/16-Emailing-with-Python/.ipynb_checkpoints/02-Exercise-Ideas-checkpoint.ipynb @@ -0,0 +1,48 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Python Email Exercise Ideas\n", + "\n", + "Since we can't really assess any code that would involve your personal email address, here are some ideas for you to test your new skills. Please keep in mind, we can not assess these." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "## Ideas\n", + "\n", + "* Daily Automatic Email Reminder for your Tasks\n", + "* Webscrape some statistics from a website automatically each day and email them to yourself\n", + "* Automatically email daily/weekly/monthly reports at your work\n", + "* Have end of day messages to your friends and family be sent out at random to spread joy\n", + "* Be creative! Mix together any of the skills you've learned so far with email :)" + ] + } + ], + "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.6.6" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/16-Emailing-with-Python/00-Overview-of-Sending-Emails.ipynb b/16-Emailing-with-Python/00-Overview-of-Sending-Emails.ipynb new file mode 100644 index 000000000..e212683e5 --- /dev/null +++ b/16-Emailing-with-Python/00-Overview-of-Sending-Emails.ipynb @@ -0,0 +1,359 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Overview of Sending Emails" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The smtplib library allows you to manually go through the steps of creating and sending an email in Python:" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "import smtplib" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Create an SMTP object for a server. Here are the main Server Domain Name for the top email services. If you don't see your email server here, you may need to do a quick Google Search to see if there SMTP server domain name is available:\n", + "\n", + "\n", + "\n", + "\n", + " \n", + " \n", + "\n", + "\n", + "\n", + " \n", + " \n", + "\n", + "\n", + " \n", + " \n", + "\n", + "\n", + " \n", + " \n", + " \n", + "\n", + "\n", + "\n", + " \n", + " \n", + "\n", + "\n", + "\n", + "\n", + " \n", + " \n", + "\n", + "\n", + "\n", + " \n", + " \n", + "\n", + "\n", + "
ProviderSMTP server domain name
Gmail (will need App Password)smtp.gmail.com
Yahoo Mailsmtp.mail.yahoo.com
Outlook.com/Hotmail.comsmtp-mail.outlook.com
AT&Tsmpt.mail.att.net (Use port 465)
Verizonsmtp.verizon.net (Use port 465)
Comcastsmtp.comcast.net
" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Next is to create an STMP object that can make the method calls to log you in to your email in order to send messages. Notice how also specify a port number. If the number 587 does not work on your computer, try using 465 instead. Keep in mind, a firewall or antivirus may prevent Python from opening up this port, so you may need to disable it on your computer." + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "smtp_object = smtplib.SMTP('smtp.gmail.com',587)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Next we run the ehlo() command which \"greets\" the server and establishes the connection. This method call should be done directly after creating the object. Calling it after other methods may result in errors in connecting later on. The first item in the tuple that is returned should be 250, indicating a successful connection." + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(250,\n", + " b'smtp.gmail.com at your service, [47.143.81.4]\\nSIZE 35882577\\n8BITMIME\\nSTARTTLS\\nENHANCEDSTATUSCODES\\nPIPELINING\\nCHUNKING\\nSMTPUTF8')" + ] + }, + "execution_count": 36, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "smtp_object.ehlo()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "When using the 587 port, this means you are using TLS encryption, which you need to initiate by running the starttls() command. If you are using port 465, this means you are using SSL and you can skip this step." + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(220, b'2.0.0 Ready to start TLS')" + ] + }, + "execution_count": 37, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "smtp_object.starttls()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now its time to set up the email and the passwords. You should never save the raw string of your password or email in a script, because anyone that sees this script will then be able to see you email and password! Instead you should use input() to get that information. If you also don't want your password to be visible when typing it in, you can use the built-in **getpass** library that will hide your password as you type it in, either with asterisks or by just keeping it invisible." + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "# For hidden passwords\n", + "import getpass" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Type something here and it will be hidden: ········\n" + ] + } + ], + "source": [ + "result = getpass.getpass(\"Type something here and it will be hidden: \")" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'a'" + ] + }, + "execution_count": 40, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Just keep in mind that its still visible as an object internally:\n", + "result" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Enter your passwords\n" + ] + }, + { + "data": { + "text/plain": [ + "'s'" + ] + }, + "execution_count": 41, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Or just use input()\n", + "input(\"Enter your password\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "____\n", + "**Note for Gmail Users, you need to generate an app password instead of your normal email password. This also requires enabling 2-step authentication. Follow the instructions here to set-up 2-Step Factor Authentication as well as App Password Generation:https://support.google.com/accounts/answer/185833?hl=en/. Set-up 2 Factor Authentication, then create the App Password, choose Mail as the App and give it any name you want. This will output a 16 letter password for you. Pass in this password as your login password for the smtp.**\n", + "____" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "email = getpass.getpass(\"Enter your email: \")\n", + "password = getpass.getpass(\"Enter your password: \")\n", + "smtp_object.login(email,password)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now we can send an email using the .sendmail() method." + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Enter your email: ········\n", + "Enter the email of the recipient: ········\n", + "Enter the subject line: This is a test\n", + "Type out the message you want to send: Here is the message.\n" + ] + }, + { + "data": { + "text/plain": [ + "{}" + ] + }, + "execution_count": 46, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "from_address = getpass.getpass(\"Enter your email: \")\n", + "to_address = getpass.getpass(\"Enter the email of the recipient: \")\n", + "subject = input(\"Enter the subject line: \")\n", + "message = input(\"Type out the message you want to send: \")\n", + "msg = \"Subject: \" + subject + '\\n' + message\n", + "smtp_object.sendmail(from_address,to_address,msg)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "If you get back an empty dictionary, then the sending was successful." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You can then close your session with the .quit() method." + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(221, b'2.0.0 closing connection j1sm22376227pgq.33 - gsmtp')" + ] + }, + "execution_count": 47, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "smtp_object.quit()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now that we know how to send emails, its time to learn how to look through emails you've already recieved." + ] + } + ], + "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.6.1" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/16-Emailing-with-Python/01-Overview-of-Received-Emails.ipynb b/16-Emailing-with-Python/01-Overview-of-Received-Emails.ipynb new file mode 100644 index 000000000..67ae7862c --- /dev/null +++ b/16-Emailing-with-Python/01-Overview-of-Received-Emails.ipynb @@ -0,0 +1,517 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Overview of Received Emails\n", + "\n", + "Now that we understand how to send emails progammatically with Python, let's explore how we can read and search recieved emails. To do we will use the built-in [imaplib library](https://docs.python.org/3/library/imaplib.html#imap4-example). We will also use the built in [email](https://docs.python.org/3/library/email.examples.html) library for parsing through the recieved emails." + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "import imaplib" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "M = imaplib.IMAP4_SSL('imap.gmail.com')" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "import getpass" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "user = input(\"Enter your email: \")" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Enter your password: ········\n" + ] + } + ], + "source": [ + "# Remember , you may need an app password if you are a gmail user\n", + "# \n", + "password = getpass.getpass(\"Enter your password: \")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "M.login(user,password)" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "('OK',\n", + " [b'(\\\\HasNoChildren) \"/\" \"INBOX\"',\n", + " b'(\\\\HasNoChildren) \"/\" \"Personal\"',\n", + " b'(\\\\HasNoChildren) \"/\" \"Receipts\"',\n", + " b'(\\\\HasNoChildren) \"/\" \"Sent\"',\n", + " b'(\\\\HasNoChildren) \"/\" \"Trash\"',\n", + " b'(\\\\HasNoChildren) \"/\" \"Travel\"',\n", + " b'(\\\\HasNoChildren) \"/\" \"Work\"',\n", + " b'(\\\\HasChildren \\\\Noselect) \"/\" \"[Gmail]\"',\n", + " b'(\\\\All \\\\HasNoChildren) \"/\" \"[Gmail]/All Mail\"',\n", + " b'(\\\\Drafts \\\\HasNoChildren) \"/\" \"[Gmail]/Drafts\"',\n", + " b'(\\\\HasNoChildren \\\\Important) \"/\" \"[Gmail]/Important\"',\n", + " b'(\\\\HasNoChildren \\\\Sent) \"/\" \"[Gmail]/Sent Mail\"',\n", + " b'(\\\\HasNoChildren \\\\Junk) \"/\" \"[Gmail]/Spam\"',\n", + " b'(\\\\Flagged \\\\HasNoChildren) \"/\" \"[Gmail]/Starred\"',\n", + " b'(\\\\HasNoChildren \\\\Trash) \"/\" \"[Gmail]/Trash\"'])" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "M.list()" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "('OK', [b'28297'])" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Connect to your inbox\n", + "M.select(\"inbox\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Searching Mail\n", + "\n", + "Now that we have connected to our mail, we should be able to search for it using the specialized syntax of IMAP. Here are the different search keys you can use:" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Keyword Definition
'ALL'\n", + " Returns all messages in your email folder. Often there are size limits from imaplib.\n", + " To change these use imaplib._MAXLINE = 100 , where 100 is whatever you want the limit to be.\n", + "
'BEFORE date'\n", + " Returns all messages before the date. Date must be formatted as 01-Nov-2000.\n", + "
'ON date'\n", + " Returns all messages on the date. Date must be formatted as 01-Nov-2000.\n", + "
'SINCE date'\n", + " Returns all messages after the date. Date must be formatted as 01-Nov-2000.\n", + "
'FROM some_string '\n", + " Returns all from the sender in the string. String can be an email, for example 'FROM user@example.com' or just a string that may appear in the email, \"FROM example\"\n", + "
'TO some_string'\n", + " Returns all outgoing email to the email in the string. String can be an email, for example 'FROM user@example.com' or just a string that may appear in the email, \"FROM example\"\n", + "
'CC some_string' and/or 'BCC some_string'\n", + " Returns all messages in your email folder. Often there are size limits from imaplib.\n", + " To change these use imaplib._MAXLINE = 100 , where 100 is whatever you want the limit to be.\n", + "
'SUBJECT string','BODY string','TEXT \"string with spaces\"'\n", + " Returns all messages with the subject string or the string in the body of the email. If the string you are searching for has spaces in it, wrap it in double quotes.\n", + "
'SEEN', 'UNSEEN'\n", + " Returns all messages that have been seen or unseen. (Also known as read or unread)\n", + "
'ANSWERED', 'UNANSWERED'\n", + " Returns all messages that have been replied to or unreplied to. \n", + "
'DELETED', 'UNDELETED'\n", + " Returns all messages that have been deleted or that have not been deleted.\n", + "
" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You can also use the logical operators AND and OR to combine the above statements. Check out the full list of search keys here: http://www.4d.com/docs/CMU/CMU88864.HTM.\n", + "\n", + "Please note that some IMAP server providers for different email services will have slightly different syntax. You may need to experiment to get the results you want.\n", + "\n", + "___________\n", + "___________\n", + "\n", + "Now we can search our mail for any term we want. " + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "# Use if you get an error saying limit was reached\n", + "imaplib._MAXLINE = 10000000" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Send yourself a test email with the subject line:\n", + "\n", + " this is a test email for python\n", + "\n", + "Or some other uniquely identifying string. \n", + "\n", + "We will now need to reconnect to our imap server. You will probably need to restart your kernel for this step if you are using jupyter notebook." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Restart your kernel and run the following:\n", + "import imaplib\n", + "import getpass\n", + "M = imaplib.IMAP4_SSL('imap.gmail.com')\n", + "user = input(\"Enter your email: \")\n", + "password = getpass.getpass(\"Enter your password: \")\n", + "M.login(user,password)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "('OK', [b'28299'])" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Connect to your inbox\n", + "M.select(\"inbox\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Let's now search and confirm if it is there:" + ] + }, + { + "cell_type": "code", + "execution_count": 105, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "typ ,data = M.search(None,'SUBJECT \"this is a test email for python\"')" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "We can now save what it has returned:" + ] + }, + { + "cell_type": "code", + "execution_count": 106, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'OK'" + ] + }, + "execution_count": 106, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "typ" + ] + }, + { + "cell_type": "code", + "execution_count": 107, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[b'28298']" + ] + }, + "execution_count": 107, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "data" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The data will be a list of unique ids." + ] + }, + { + "cell_type": "code", + "execution_count": 108, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "\n", + "# typ, data = M.fetch(data[0],\"(RFC822)\")" + ] + }, + { + "cell_type": "code", + "execution_count": 112, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "result, email_data = M.fetch(data[0],\"(RFC822)\")" + ] + }, + { + "cell_type": "code", + "execution_count": 113, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "raw_email = email_data[0][1]" + ] + }, + { + "cell_type": "code", + "execution_count": 116, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "raw_email_string = raw_email.decode('utf-8')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can use the built in email library to help parse this raw string." + ] + }, + { + "cell_type": "code", + "execution_count": 120, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "import email" + ] + }, + { + "cell_type": "code", + "execution_count": 121, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "email_message = email.message_from_string(raw_email_string)" + ] + }, + { + "cell_type": "code", + "execution_count": 125, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "b'This is a test to see if the python search worked.\\r\\n'\n" + ] + } + ], + "source": [ + "for part in email_message.walk():\n", + " if part.get_content_type() == \"text/plain\":\n", + " body = part.get_payload(decode=True)\n", + " print(body)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Excellent! We've successfully have been able to check our email's inbox , filter by some condition, and read the body of the text that was there. This will come in handy in the near future!" + ] + } + ], + "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.6.1" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/16-Emailing-with-Python/02-Exercise-Ideas.ipynb b/16-Emailing-with-Python/02-Exercise-Ideas.ipynb new file mode 100644 index 000000000..0f7d6c49e --- /dev/null +++ b/16-Emailing-with-Python/02-Exercise-Ideas.ipynb @@ -0,0 +1,48 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Python Email Exercise Ideas\n", + "\n", + "Since we can't really assess any code that would involve your personal email address, here are some ideas for you to test your new skills. Please keep in mind, we can not assess these." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "## Ideas\n", + "\n", + "* Daily Automatic Email Reminder for your Tasks\n", + "* Webscrape some statistics from a website automatically each day and email them to yourself\n", + "* Automatically email daily/weekly/monthly reports at your work\n", + "* Have end of day messages to your friends and family be sent out at random to spread joy\n", + "* Be creative! Mix together any of the skills you've learned so far with email :)" + ] + } + ], + "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.6.6" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/16-Milestone Project - 3/.ipynb_checkpoints/01-Final Capstone Project-checkpoint.ipynb b/18-Milestone Project - 3/.ipynb_checkpoints/01-Final Capstone Project-checkpoint.ipynb similarity index 100% rename from 16-Milestone Project - 3/.ipynb_checkpoints/01-Final Capstone Project-checkpoint.ipynb rename to 18-Milestone Project - 3/.ipynb_checkpoints/01-Final Capstone Project-checkpoint.ipynb diff --git a/16-Milestone Project - 3/.ipynb_checkpoints/02-Final Capstone Project Ideas-checkpoint.ipynb b/18-Milestone Project - 3/.ipynb_checkpoints/02-Final Capstone Project Ideas-checkpoint.ipynb similarity index 100% rename from 16-Milestone Project - 3/.ipynb_checkpoints/02-Final Capstone Project Ideas-checkpoint.ipynb rename to 18-Milestone Project - 3/.ipynb_checkpoints/02-Final Capstone Project Ideas-checkpoint.ipynb diff --git a/16-Milestone Project - 3/01-Final Capstone Project.ipynb b/18-Milestone Project - 3/01-Final Capstone Project.ipynb similarity index 100% rename from 16-Milestone Project - 3/01-Final Capstone Project.ipynb rename to 18-Milestone Project - 3/01-Final Capstone Project.ipynb diff --git a/16-Milestone Project - 3/02-Final Capstone Project Ideas.ipynb b/18-Milestone Project - 3/02-Final Capstone Project Ideas.ipynb similarity index 100% rename from 16-Milestone Project - 3/02-Final Capstone Project Ideas.ipynb rename to 18-Milestone Project - 3/02-Final Capstone Project Ideas.ipynb diff --git a/16-Milestone Project - 3/Projects-Solutions/Solution Links.md b/18-Milestone Project - 3/Projects-Solutions/Solution Links.md similarity index 100% rename from 16-Milestone Project - 3/Projects-Solutions/Solution Links.md rename to 18-Milestone Project - 3/Projects-Solutions/Solution Links.md diff --git a/18-Bonus Material - Introduction to GUIs/.ipynb_checkpoints/01-Interact-checkpoint.ipynb b/19-Bonus Material - Introduction to GUIs/.ipynb_checkpoints/01-Interact-checkpoint.ipynb similarity index 100% rename from 18-Bonus Material - Introduction to GUIs/.ipynb_checkpoints/01-Interact-checkpoint.ipynb rename to 19-Bonus Material - Introduction to GUIs/.ipynb_checkpoints/01-Interact-checkpoint.ipynb diff --git a/18-Bonus Material - Introduction to GUIs/.ipynb_checkpoints/02-Widget Basics-checkpoint.ipynb b/19-Bonus Material - Introduction to GUIs/.ipynb_checkpoints/02-Widget Basics-checkpoint.ipynb similarity index 100% rename from 18-Bonus Material - Introduction to GUIs/.ipynb_checkpoints/02-Widget Basics-checkpoint.ipynb rename to 19-Bonus Material - Introduction to GUIs/.ipynb_checkpoints/02-Widget Basics-checkpoint.ipynb diff --git a/18-Bonus Material - Introduction to GUIs/.ipynb_checkpoints/03-Widget List-checkpoint.ipynb b/19-Bonus Material - Introduction to GUIs/.ipynb_checkpoints/03-Widget List-checkpoint.ipynb similarity index 100% rename from 18-Bonus Material - Introduction to GUIs/.ipynb_checkpoints/03-Widget List-checkpoint.ipynb rename to 19-Bonus Material - Introduction to GUIs/.ipynb_checkpoints/03-Widget List-checkpoint.ipynb diff --git a/18-Bonus Material - Introduction to GUIs/.ipynb_checkpoints/04-Widget Events-checkpoint.ipynb b/19-Bonus Material - Introduction to GUIs/.ipynb_checkpoints/04-Widget Events-checkpoint.ipynb similarity index 100% rename from 18-Bonus Material - Introduction to GUIs/.ipynb_checkpoints/04-Widget Events-checkpoint.ipynb rename to 19-Bonus Material - Introduction to GUIs/.ipynb_checkpoints/04-Widget Events-checkpoint.ipynb diff --git a/18-Bonus Material - Introduction to GUIs/.ipynb_checkpoints/05-Widget Styling-checkpoint.ipynb b/19-Bonus Material - Introduction to GUIs/.ipynb_checkpoints/05-Widget Styling-checkpoint.ipynb similarity index 100% rename from 18-Bonus Material - Introduction to GUIs/.ipynb_checkpoints/05-Widget Styling-checkpoint.ipynb rename to 19-Bonus Material - Introduction to GUIs/.ipynb_checkpoints/05-Widget Styling-checkpoint.ipynb diff --git a/18-Bonus Material - Introduction to GUIs/.ipynb_checkpoints/06-Custom Widget-checkpoint.ipynb b/19-Bonus Material - Introduction to GUIs/.ipynb_checkpoints/06-Custom Widget-checkpoint.ipynb similarity index 100% rename from 18-Bonus Material - Introduction to GUIs/.ipynb_checkpoints/06-Custom Widget-checkpoint.ipynb rename to 19-Bonus Material - Introduction to GUIs/.ipynb_checkpoints/06-Custom Widget-checkpoint.ipynb diff --git a/18-Bonus Material - Introduction to GUIs/.ipynb_checkpoints/07-Advanced Widget List-checkpoint.ipynb b/19-Bonus Material - Introduction to GUIs/.ipynb_checkpoints/07-Advanced Widget List-checkpoint.ipynb similarity index 100% rename from 18-Bonus Material - Introduction to GUIs/.ipynb_checkpoints/07-Advanced Widget List-checkpoint.ipynb rename to 19-Bonus Material - Introduction to GUIs/.ipynb_checkpoints/07-Advanced Widget List-checkpoint.ipynb diff --git a/18-Bonus Material - Introduction to GUIs/.ipynb_checkpoints/08-Advanced Widget Styling with Layout-checkpoint.ipynb b/19-Bonus Material - Introduction to GUIs/.ipynb_checkpoints/08-Advanced Widget Styling with Layout-checkpoint.ipynb similarity index 100% rename from 18-Bonus Material - Introduction to GUIs/.ipynb_checkpoints/08-Advanced Widget Styling with Layout-checkpoint.ipynb rename to 19-Bonus Material - Introduction to GUIs/.ipynb_checkpoints/08-Advanced Widget Styling with Layout-checkpoint.ipynb diff --git a/18-Bonus Material - Introduction to GUIs/01-Interact.ipynb b/19-Bonus Material - Introduction to GUIs/01-Interact.ipynb similarity index 100% rename from 18-Bonus Material - Introduction to GUIs/01-Interact.ipynb rename to 19-Bonus Material - Introduction to GUIs/01-Interact.ipynb diff --git a/18-Bonus Material - Introduction to GUIs/02-Widget Basics.ipynb b/19-Bonus Material - Introduction to GUIs/02-Widget Basics.ipynb similarity index 100% rename from 18-Bonus Material - Introduction to GUIs/02-Widget Basics.ipynb rename to 19-Bonus Material - Introduction to GUIs/02-Widget Basics.ipynb diff --git a/18-Bonus Material - Introduction to GUIs/03-Widget List.ipynb b/19-Bonus Material - Introduction to GUIs/03-Widget List.ipynb similarity index 100% rename from 18-Bonus Material - Introduction to GUIs/03-Widget List.ipynb rename to 19-Bonus Material - Introduction to GUIs/03-Widget List.ipynb diff --git a/18-Bonus Material - Introduction to GUIs/04-Widget Events.ipynb b/19-Bonus Material - Introduction to GUIs/04-Widget Events.ipynb similarity index 100% rename from 18-Bonus Material - Introduction to GUIs/04-Widget Events.ipynb rename to 19-Bonus Material - Introduction to GUIs/04-Widget Events.ipynb diff --git a/18-Bonus Material - Introduction to GUIs/05-Widget Styling.ipynb b/19-Bonus Material - Introduction to GUIs/05-Widget Styling.ipynb similarity index 100% rename from 18-Bonus Material - Introduction to GUIs/05-Widget Styling.ipynb rename to 19-Bonus Material - Introduction to GUIs/05-Widget Styling.ipynb diff --git a/18-Bonus Material - Introduction to GUIs/06-Custom Widget.ipynb b/19-Bonus Material - Introduction to GUIs/06-Custom Widget.ipynb similarity index 100% rename from 18-Bonus Material - Introduction to GUIs/06-Custom Widget.ipynb rename to 19-Bonus Material - Introduction to GUIs/06-Custom Widget.ipynb diff --git a/18-Bonus Material - Introduction to GUIs/07-Advanced Widget List.ipynb b/19-Bonus Material - Introduction to GUIs/07-Advanced Widget List.ipynb similarity index 100% rename from 18-Bonus Material - Introduction to GUIs/07-Advanced Widget List.ipynb rename to 19-Bonus Material - Introduction to GUIs/07-Advanced Widget List.ipynb diff --git a/18-Bonus Material - Introduction to GUIs/08-Advanced Widget Styling with Layout.ipynb b/19-Bonus Material - Introduction to GUIs/08-Advanced Widget Styling with Layout.ipynb similarity index 100% rename from 18-Bonus Material - Introduction to GUIs/08-Advanced Widget Styling with Layout.ipynb rename to 19-Bonus Material - Introduction to GUIs/08-Advanced Widget Styling with Layout.ipynb