From 431edc37ed97f9209dd3e41f4f27ff09f519028e Mon Sep 17 00:00:00 2001 From: Jackson North Date: Wed, 4 Feb 2026 11:50:36 -0700 Subject: [PATCH 1/2] Test edit from CHPC --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f958c19..b449085 100644 --- a/README.md +++ b/README.md @@ -34,3 +34,4 @@ This repositories consists of three core Python topics: Each section will help new users gain confidence in the fundamentals of Python, and prepare new developers for more complex modules and to start developing their own codebase. +Test edit Wed Feb 4 11:50:26 MST 2026 From d35d9a3b63e98bf22187475d501e63843734c22f Mon Sep 17 00:00:00 2001 From: Jackson North Date: Wed, 4 Feb 2026 12:03:29 -0700 Subject: [PATCH 2/2] Complete Module 1 exercises --- Intro2Python/Module1-DataTypes.ipynb | 168 ++++++++++++++++++--------- 1 file changed, 115 insertions(+), 53 deletions(-) diff --git a/Intro2Python/Module1-DataTypes.ipynb b/Intro2Python/Module1-DataTypes.ipynb index fc104f6..81040a0 100644 --- a/Intro2Python/Module1-DataTypes.ipynb +++ b/Intro2Python/Module1-DataTypes.ipynb @@ -50,7 +50,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 2, "metadata": {}, "outputs": [ { @@ -59,7 +59,7 @@ "239" ] }, - "execution_count": 4, + "execution_count": 2, "metadata": {}, "output_type": "execute_result" } @@ -70,7 +70,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 3, "metadata": {}, "outputs": [ { @@ -79,7 +79,7 @@ "2" ] }, - "execution_count": 5, + "execution_count": 3, "metadata": {}, "output_type": "execute_result" } @@ -97,7 +97,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 4, "metadata": {}, "outputs": [ { @@ -175,10 +175,10 @@ "evalue": "'str' object does not support item assignment", "output_type": "error", "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn[6], line 3\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;66;03m#try to change the strings\u001b[39;00m\n\u001b[1;32m 2\u001b[0m \u001b[38;5;28mprint\u001b[39m(e[\u001b[38;5;241m0\u001b[39m]) \u001b[38;5;66;03m#Call the first character of the e string from above\u001b[39;00m\n\u001b[0;32m----> 3\u001b[0m \u001b[43me\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;241;43m0\u001b[39;49m\u001b[43m]\u001b[49m \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mh\u001b[39m\u001b[38;5;124m'\u001b[39m \u001b[38;5;66;03m# This will raise an error because strings are immutable\u001b[39;00m\n", - "\u001b[0;31mTypeError\u001b[0m: 'str' object does not support item assignment" + "\u001b[31m---------------------------------------------------------------------------\u001b[39m", + "\u001b[31mTypeError\u001b[39m Traceback (most recent call last)", + "\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[6]\u001b[39m\u001b[32m, line 3\u001b[39m\n\u001b[32m 1\u001b[39m \u001b[38;5;66;03m#try to change the strings\u001b[39;00m\n\u001b[32m 2\u001b[39m \u001b[38;5;28mprint\u001b[39m(e[\u001b[32m0\u001b[39m]) \u001b[38;5;66;03m#Call the first character of the e string from above\u001b[39;00m\n\u001b[32m----> \u001b[39m\u001b[32m3\u001b[39m \u001b[43me\u001b[49m\u001b[43m[\u001b[49m\u001b[32;43m0\u001b[39;49m\u001b[43m]\u001b[49m = \u001b[33m'\u001b[39m\u001b[33mh\u001b[39m\u001b[33m'\u001b[39m \u001b[38;5;66;03m# This will raise an error because strings are immutable\u001b[39;00m\n", + "\u001b[31mTypeError\u001b[39m: 'str' object does not support item assignment" ] } ], @@ -235,7 +235,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -255,7 +255,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -282,7 +282,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -301,7 +301,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -327,7 +327,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -369,7 +369,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -404,7 +404,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -434,7 +434,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -460,7 +460,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -487,7 +487,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -514,7 +514,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -535,7 +535,7 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -570,7 +570,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -592,7 +592,7 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -617,7 +617,7 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -642,7 +642,7 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -662,7 +662,7 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -690,7 +690,7 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -722,7 +722,7 @@ }, { "cell_type": "code", - "execution_count": 31, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -755,7 +755,7 @@ }, { "cell_type": "code", - "execution_count": 32, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -792,7 +792,7 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -812,7 +812,7 @@ }, { "cell_type": "code", - "execution_count": 34, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -832,7 +832,7 @@ }, { "cell_type": "code", - "execution_count": 35, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -871,7 +871,7 @@ }, { "cell_type": "code", - "execution_count": 36, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -899,7 +899,7 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -926,7 +926,7 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -946,7 +946,7 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -983,10 +983,24 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "metadata": {}, - "outputs": [], - "source": [] + "outputs": [ + { + "data": { + "text/plain": [ + "62" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "s = \"Utah's SNOTEL sites are recording below average snow this year\"\n", + "len(s)" + ] }, { "cell_type": "markdown", @@ -998,10 +1012,23 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "metadata": {}, - "outputs": [], - "source": [] + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "s.endswith(\"year\")" + ] }, { "cell_type": "markdown", @@ -1019,10 +1046,20 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 9, "metadata": {}, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "There are 62 SNOTEL sites in Utah.\n" + ] + } + ], + "source": [ + "print(f\"There are {len(s)} SNOTEL sites in Utah.\")" + ] }, { "cell_type": "markdown", @@ -1034,10 +1071,20 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 10, "metadata": {}, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "7\n" + ] + } + ], + "source": [ + "print(s.count(\"e\"))" + ] }, { "cell_type": "markdown", @@ -1055,10 +1102,25 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 11, "metadata": {}, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "SNOTEL in situ monitoring sites support regional water management activities\n", + "USGS in situ monitoring sites support regional water management activities\n" + ] + } + ], + "source": [ + "string1 = \"SNOTEL in situ monitoring sites support regional water management activities\"\n", + "string2 = string1.replace(\"SNOTEL\", \"USGS\")\n", + "\n", + "print(string1)\n", + "print(string2)" + ] }, { "cell_type": "markdown", @@ -1076,7 +1138,7 @@ "metadata": { "hide_input": false, "kernelspec": { - "display_name": "p310env", + "display_name": "hydro_py", "language": "python", "name": "python3" }, @@ -1090,7 +1152,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.19" + "version": "3.11.14" }, "latex_envs": { "LaTeX_envs_menu_present": true,