diff --git a/your-code/challenges.ipynb b/your-code/challenges.ipynb index ba91b3f..4f28c1b 100644 --- a/your-code/challenges.ipynb +++ b/your-code/challenges.ipynb @@ -11,13 +11,29 @@ "**In the cell below, define a variable `tup` with a single element `\"I\"`.**\n" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [] + }, { "cell_type": "code", - "execution_count": null, + "execution_count": 15, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "I\n" + ] + } + ], "source": [ - "# Your code here" + "# Your code here \n", + "tup = (\"I\")\n", + "print (tup)\n", + "\n" ] }, { @@ -31,11 +47,22 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n" + ] + } + ], "source": [ - "# Your code here" + "# Your code here\n", + "print (type (tup ))\n", + "\n", + "\n" ] }, { @@ -53,13 +80,27 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 36, "metadata": { "scrolled": true }, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['I', ['r', 'o', 'n', 'h', ' a', 'c', 'k']]\n" + ] + } + ], "source": [ "# Your code here\n", + "tup = [\"I\"]\n", + "tap = ['r', 'o', 'n', 'h',' a', 'c', 'k' ]\n", + "tup.append(tap)\n", + "print (tup)\n", + "\n", + "\n", "\n", "# Your explanation here\n", "# You can :) " @@ -80,11 +121,22 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 38, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['I', 'r', 'o', 'n', 'h', ' a', 'c', 'k']\n" + ] + } + ], "source": [ - "# Your code here" + "# Your code here\n", + "lista = ['I', ['r', 'o', 'n', 'h', ' a', 'c', 'k']]\n", + "tup = [lista[0]] + lista[1]\n", + "print (tup)" ] }, { @@ -102,11 +154,26 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 45, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['I', 'r', 'o', 'n']\n", + "['h', ' a', 'c', 'k']\n" + ] + } + ], "source": [ - "# Your code here" + "# Your code here\n", + "tup1 = tup[:4]\n", + "print(tup1)\n", + "\n", + "tup2 = tup[-4:]\n", + "print(tup2)\n", + "\n" ] }, { @@ -120,11 +187,21 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 46, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['I', 'r', 'o', 'n', 'h', ' a', 'c', 'k']\n" + ] + } + ], "source": [ - "# Your code here" + "# Your code here\n", + "tup3 = tup1 + tup2\n", + "print(tup3)\n" ] }, { @@ -140,7 +217,7 @@ "metadata": {}, "outputs": [], "source": [ - "# Your code here" + "# Your code here\n" ] }, { @@ -602,7 +679,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "base", "language": "python", "name": "python3" }, @@ -616,12 +693,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" - }, - "vscode": { - "interpreter": { - "hash": "aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49" - } + "version": "3.13.5" } }, "nbformat": 4,