From 1aaf363c08866ca292be5bfc892b31229e26795c Mon Sep 17 00:00:00 2001 From: Pau Serra Date: Mon, 18 Jan 2021 17:31:28 +0100 Subject: [PATCH] Lab finished --- your-code/main.ipynb | 82 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 73 insertions(+), 9 deletions(-) diff --git a/your-code/main.ipynb b/your-code/main.ipynb index 01257d4..6d61cb6 100755 --- a/your-code/main.ipynb +++ b/your-code/main.ipynb @@ -21,7 +21,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -32,7 +32,8 @@ " \"\"\"\n", " \n", " # your code here\n", - " " + " return [lmbda(x) for x in lst]\n", + " " ] }, { @@ -50,7 +51,8 @@ "metadata": {}, "outputs": [], "source": [ - "# your code here" + "# your code here\n", + "f = lambda x: x + 273.15" ] }, { @@ -62,13 +64,25 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "[285.15, 296.15, 311.15, 218.14999999999998, 297.15]" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "temps = [12, 23, 38, -55, 24]\n", "\n", - "# your code here" + "# your code here\n", + "modify_list(temps, f)" ] }, { @@ -82,11 +96,32 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 11, "metadata": {}, "outputs": [], "source": [ - "# your code here" + "# your code here\n", + "mod = lambda x, y: 1 if x % y == 0 else 0" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "mod(5,5)" ] }, { @@ -269,7 +304,36 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.2" + "version": "3.9.0" + }, + "varInspector": { + "cols": { + "lenName": 16, + "lenType": 16, + "lenVar": 40 + }, + "kernels_config": { + "python": { + "delete_cmd_postfix": "", + "delete_cmd_prefix": "del ", + "library": "var_list.py", + "varRefreshCmd": "print(var_dic_list())" + }, + "r": { + "delete_cmd_postfix": ") ", + "delete_cmd_prefix": "rm(", + "library": "var_list.r", + "varRefreshCmd": "cat(var_dic_list()) " + } + }, + "types_to_exclude": [ + "module", + "function", + "builtin_function_or_method", + "instance", + "_Feature" + ], + "window_display": false } }, "nbformat": 4,