From bc677f6ad57d36a5da9e27e8a59bc18b5bf96a7c Mon Sep 17 00:00:00 2001 From: ECG01 Date: Mon, 2 Dec 2024 14:42:50 -0400 Subject: [PATCH 1/2] Ed_code --- .../{main.ipynb => main_Edwad_Cruz.ipynb} | 214 ++++++++++++++---- 1 file changed, 176 insertions(+), 38 deletions(-) rename your-code/{main.ipynb => main_Edwad_Cruz.ipynb} (51%) diff --git a/your-code/main.ipynb b/your-code/main_Edwad_Cruz.ipynb similarity index 51% rename from your-code/main.ipynb rename to your-code/main_Edwad_Cruz.ipynb index de27676..90ea0dc 100644 --- a/your-code/main.ipynb +++ b/your-code/main_Edwad_Cruz.ipynb @@ -9,7 +9,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": {}, "outputs": [], "source": [ @@ -25,11 +25,31 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "PLAY\n", + "FILLING\n", + "BAR\n", + "THEATRE\n", + "EASYGOING\n", + "DATE\n", + "LEAD\n", + "THAT\n", + "STORY\n", + "ISLAND\n" + ] + } + ], "source": [ - "# your code here" + "# your code here\n", + "for word in words:\n", + " upper = word.upper()\n", + " print(upper)" ] }, { @@ -41,11 +61,12 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "metadata": {}, "outputs": [], "source": [ - "# your code here" + "# your code here\n", + "new_list = ['playing','Edward','theatre','beaches','elephant','zebra']" ] }, { @@ -57,11 +78,24 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "theatre\n" + ] + } + ], "source": [ - "# your code here" + "# your code here\n", + "for wordd in new_list:\n", + " if wordd[0] == 't':\n", + " print(wordd)\n", + " else:\n", + " pass" ] }, { @@ -80,11 +114,24 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 11, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[1, 4, 9, 16, 25, 36, 49, 64, 81, 100]\n" + ] + } + ], "source": [ - "# your code here" + "# your code here\n", + "listt = []\n", + "for i in range(1,11):\n", + " square = i**2\n", + " listt.append(square)\n", + "print(listt)" ] }, { @@ -96,11 +143,27 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 13, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[2, 4, 6, 8, 10]\n" + ] + } + ], "source": [ - "# your code here" + "# your code here\n", + "listts = []\n", + "for i in range(1,11):\n", + " if i % 2 == 0:\n", + " listts.append(i)\n", + " else:\n", + " pass\n", + "\n", + "print(listts)" ] }, { @@ -112,11 +175,26 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 14, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136, 144, 152, 160, 168, 176, 184, 192, 200, 208, 216, 224, 232, 240, 248, 256, 264, 272, 280, 288, 296, 304, 312, 320, 328, 336, 344, 352, 360, 368, 376, 384, 392, 400, 408, 416, 424, 432, 440, 448, 456, 464, 472, 480, 488, 496, 504, 512, 520, 528, 536, 544, 552, 560, 568, 576, 584, 592, 600, 608, 616, 624, 632, 640, 648, 656, 664, 672, 680, 688, 696, 704, 712, 720, 728, 736, 744, 752, 760, 768, 776, 784, 792, 800, 808, 816, 824, 832, 840, 848, 856, 864, 872, 880, 888, 896, 904, 912, 920, 928, 936, 944, 952, 960, 968, 976, 984, 992, 1000]\n" + ] + } + ], "source": [ - "# your code here" + "# your code here\n", + "littts = []\n", + "for i in range(1,1001):\n", + " if i % 8 == 0:\n", + " littts.append(i)\n", + " else:\n", + " pass\n", + "print(littts)" ] }, { @@ -128,7 +206,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 15, "metadata": {}, "outputs": [], "source": [ @@ -170,11 +248,22 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 53, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "There are 5 people on the list.\n" + ] + } + ], "source": [ - "# your code here" + "# your code here\n", + "print(f\"There are {len(people)} people on the list.\")\n", + "\n", + "\n" ] }, { @@ -186,11 +275,26 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 51, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "4 people have kids.\n" + ] + } + ], "source": [ - "# your code here" + "# your code here\n", + "count = 0\n", + "for person in people:\n", + " if person['n_kids'] > 0:\n", + " count += 1 \n", + " else:\n", + " pass\n", + "print(f\"{count} people have kids.\")\n" ] }, { @@ -202,11 +306,30 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 52, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " There are 12 in total.\n" + ] + } + ], "source": [ - "# your code here" + "# your code here\n", + "total_kids = []\n", + "for person in people:\n", + " if person['n_kids'] > 0:\n", + " total_kids.append(person['n_kids'])\n", + " else:\n", + " pass\n", + "print(f\" There are {sum(total_kids)} in total.\")\n", + "\n", + "\n", + "\n", + " " ] }, { @@ -218,17 +341,37 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 43, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Sonia\n", + "1\n", + "Lucía\n", + "2\n", + "[{'name': 'Juan', 'age': 34, 'n_kids': 2}, {'name': 'Pepe', 'age': 27, 'n_kids': 0}, {'name': 'Sonia', 'age': 41, 'n_kids': 2}, {'name': 'Lucía', 'age': 22, 'n_kids': 3}, {'name': 'Leo', 'age': 55, 'n_kids': 5}]\n" + ] + } + ], "source": [ - "# your code here" + "# your code here\n", + "for person in people:\n", + " if person['name'][-1] == 'a':\n", + " print(person['name'])\n", + " print(person['n_kids'])\n", + " person['n_kids'] += 1\n", + " else:\n", + " pass\n", + "print(people)" ] } ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "base", "language": "python", "name": "python3" }, @@ -242,7 +385,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.11.5" }, "toc": { "base_numbering": 1, @@ -285,11 +428,6 @@ "_Feature" ], "window_display": false - }, - "vscode": { - "interpreter": { - "hash": "aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49" - } } }, "nbformat": 4, From fcba6e4a429c328f5d9e3703a18506d59789e2d6 Mon Sep 17 00:00:00 2001 From: ECG01 Date: Mon, 2 Dec 2024 15:08:07 -0400 Subject: [PATCH 2/2] Edwardlab 1 --- your-code/main_Edwad_Cruz.ipynb | 46 +++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/your-code/main_Edwad_Cruz.ipynb b/your-code/main_Edwad_Cruz.ipynb index 90ea0dc..4817e5c 100644 --- a/your-code/main_Edwad_Cruz.ipynb +++ b/your-code/main_Edwad_Cruz.ipynb @@ -9,7 +9,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ @@ -25,7 +25,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 4, "metadata": {}, "outputs": [ { @@ -61,12 +61,24 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 6, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "['filling', 'theatre', 'easygoing', 'story', 'island']" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "# your code here\n", - "new_list = ['playing','Edward','theatre','beaches','elephant','zebra']" + "new_list = [word for word in words if len(word) >= 5]\n", + "new_list" ] }, { @@ -78,7 +90,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 7, "metadata": {}, "outputs": [ { @@ -114,7 +126,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 8, "metadata": {}, "outputs": [ { @@ -143,14 +155,14 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 9, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "[2, 4, 6, 8, 10]\n" + "[1, 3, 5, 7, 9]\n" ] } ], @@ -158,7 +170,7 @@ "# your code here\n", "listts = []\n", "for i in range(1,11):\n", - " if i % 2 == 0:\n", + " if i % 2 != 0:\n", " listts.append(i)\n", " else:\n", " pass\n", @@ -175,7 +187,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 10, "metadata": {}, "outputs": [ { @@ -206,7 +218,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 11, "metadata": {}, "outputs": [], "source": [ @@ -248,7 +260,7 @@ }, { "cell_type": "code", - "execution_count": 53, + "execution_count": 12, "metadata": {}, "outputs": [ { @@ -275,7 +287,7 @@ }, { "cell_type": "code", - "execution_count": 51, + "execution_count": 13, "metadata": {}, "outputs": [ { @@ -306,14 +318,14 @@ }, { "cell_type": "code", - "execution_count": 52, + "execution_count": 14, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - " There are 12 in total.\n" + " There are 10 in total.\n" ] } ], @@ -341,7 +353,7 @@ }, { "cell_type": "code", - "execution_count": 43, + "execution_count": 15, "metadata": {}, "outputs": [ {