From 38c8c0be10c6ab663ebfd7f4ea9fe0c54f51aa8b Mon Sep 17 00:00:00 2001 From: "github-classroom[bot]" <66690702+github-classroom[bot]@users.noreply.github.com> Date: Tue, 9 Sep 2025 00:35:26 +0000 Subject: [PATCH 1/9] Setting up GitHub Classroom Feedback From d1026ba6debed9967ddac5d603d92cfadce69d00 Mon Sep 17 00:00:00 2001 From: Nathan Makowski Date: Tue, 9 Sep 2025 01:32:53 +0000 Subject: [PATCH 2/9] Initial commit --- Module_1_Part_2_Makowski.ipynb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Module_1_Part_2_Makowski.ipynb diff --git a/Module_1_Part_2_Makowski.ipynb b/Module_1_Part_2_Makowski.ipynb new file mode 100644 index 0000000..ab9c42b --- /dev/null +++ b/Module_1_Part_2_Makowski.ipynb @@ -0,0 +1,25 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "id": "58240e24", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "name": "python", + "version": "3.12.1" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} From 512207202e2c55cd058f043abe468835d313b2ea Mon Sep 17 00:00:00 2001 From: Nathan Makowski Date: Tue, 9 Sep 2025 01:34:15 +0000 Subject: [PATCH 3/9] Created initial docstring --- Module_1_Part_2_Makowski.ipynb | 36 +++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/Module_1_Part_2_Makowski.ipynb b/Module_1_Part_2_Makowski.ipynb index ab9c42b..4718b3c 100644 --- a/Module_1_Part_2_Makowski.ipynb +++ b/Module_1_Part_2_Makowski.ipynb @@ -2,9 +2,35 @@ "cells": [ { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "id": "58240e24", "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'Temperature Conversion Tool.\\n\\nThis program prompts the user for a temperature in Fahrenheit,\\nconverts it to Celsius and Kelvin using a function, and then\\nprints the results.\\n'" + ] + }, + "execution_count": 1, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "\"\"\"Temperature Conversion Tool.\n", + "\n", + "This program prompts the user for a temperature in Fahrenheit,\n", + "converts it to Celsius and Kelvin using a function, and then\n", + "prints the results.\n", + "\"\"\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ee4cf849", + "metadata": {}, "outputs": [], "source": [] } @@ -16,7 +42,15 @@ "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.12.1" } }, From e995bbf3c3768e5e025b03348a694860bd6b8dc4 Mon Sep 17 00:00:00 2001 From: Nathan Makowski Date: Tue, 9 Sep 2025 01:35:58 +0000 Subject: [PATCH 4/9] Function to calculate Celsius and Kelvin --- Module_1_Part_2_Makowski.ipynb | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Module_1_Part_2_Makowski.ipynb b/Module_1_Part_2_Makowski.ipynb index 4718b3c..2074338 100644 --- a/Module_1_Part_2_Makowski.ipynb +++ b/Module_1_Part_2_Makowski.ipynb @@ -32,7 +32,20 @@ "id": "ee4cf849", "metadata": {}, "outputs": [], - "source": [] + "source": [ + "def fahrenheit_to_celsius_kelvin(fahrenheit: float) -> tuple[float, float]:\n", + " \"\"\"Convert Fahrenheit temperature to Celsius and Kelvin.\n", + "\n", + " Args:\n", + " fahrenheit (float): Temperature in degrees Fahrenheit.\n", + "\n", + " Returns:\n", + " tuple[float, float]: Converted temperatures in Celsius and Kelvin.\n", + " \"\"\"\n", + " celsius = (fahrenheit - 32) * 5 / 9\n", + " kelvin = celsius + 273.15\n", + " return celsius, kelvin" + ] } ], "metadata": { From 013548784f8700791fae430f4b710e84806360e5 Mon Sep 17 00:00:00 2001 From: Nathan Makowski Date: Tue, 9 Sep 2025 01:37:01 +0000 Subject: [PATCH 5/9] Requesting user input --- Module_1_Part_2_Makowski.ipynb | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/Module_1_Part_2_Makowski.ipynb b/Module_1_Part_2_Makowski.ipynb index 2074338..a7045f1 100644 --- a/Module_1_Part_2_Makowski.ipynb +++ b/Module_1_Part_2_Makowski.ipynb @@ -28,7 +28,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "id": "ee4cf849", "metadata": {}, "outputs": [], @@ -46,6 +46,25 @@ " kelvin = celsius + 273.15\n", " return celsius, kelvin" ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "dbf4afbf", + "metadata": {}, + "outputs": [], + "source": [ + "# Request user input\n", + "fahrenheit_input = float(input(\"Enter temperature in Fahrenheit: \"))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ac297bb3", + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { From e8722ad45bf2ce1dc7c13ba08a1ad958a40ea8cb Mon Sep 17 00:00:00 2001 From: Nathan Makowski Date: Tue, 9 Sep 2025 01:37:54 +0000 Subject: [PATCH 6/9] Perform conversion and display results --- Module_1_Part_2_Makowski.ipynb | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/Module_1_Part_2_Makowski.ipynb b/Module_1_Part_2_Makowski.ipynb index a7045f1..526cb66 100644 --- a/Module_1_Part_2_Makowski.ipynb +++ b/Module_1_Part_2_Makowski.ipynb @@ -60,9 +60,36 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "id": "ac297bb3", "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "Input Temperature: 212.00 °F\n", + "Converted to Celsius: 100.00 °C\n", + "Converted to Kelvin: 373.15 K\n" + ] + } + ], + "source": [ + "# Perform conversion\n", + "celsius_output, kelvin_output = fahrenheit_to_celsius_kelvin(fahrenheit_input)\n", + "\n", + "# Display results\n", + "print(f\"\\nInput Temperature: {fahrenheit_input:.2f} °F\")\n", + "print(f\"Converted to Celsius: {celsius_output:.2f} °C\")\n", + "print(f\"Converted to Kelvin: {kelvin_output:.2f} K\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b81dffde", + "metadata": {}, "outputs": [], "source": [] } From c20d681751cfefa15021cbbb7a37ea2149b7f945 Mon Sep 17 00:00:00 2001 From: Nathan Makowski Date: Tue, 9 Sep 2025 02:50:14 +0000 Subject: [PATCH 7/9] Docstring created, function defined, request user input, simple calculation, and results displayed for OFFICIAL BRANCH --- Module_1_Part_2_Makowski.ipynb | 72 +++++++++++++++++++++++++++++++++- 1 file changed, 71 insertions(+), 1 deletion(-) diff --git a/Module_1_Part_2_Makowski.ipynb b/Module_1_Part_2_Makowski.ipynb index 526cb66..d338a75 100644 --- a/Module_1_Part_2_Makowski.ipynb +++ b/Module_1_Part_2_Makowski.ipynb @@ -87,9 +87,79 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "id": "b81dffde", "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'Temperature Conversion Tool.\\n\\nThis program prompts the user for a temperature in Celsius,\\nconverts it to Fahrenheit and Kelvin using a function, and then\\nprints the results.\\n'" + ] + }, + "execution_count": 1, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "\"\"\"Temperature Conversion Tool.\n", + "\n", + "This program prompts the user for a temperature in Celsius,\n", + "converts it to Fahrenheit and Kelvin using a function, and then\n", + "prints the results.\n", + "\"\"\"" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "5bc14a1b", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "Input Temperature: 100.00 °C\n", + "Converted to Fahrenheit: 212.00 °F\n", + "Converted to Kelvin: 373.15 K\n" + ] + } + ], + "source": [ + "def celsius_to_fahrenheit_kelvin(celsius: float) -> tuple[float, float]:\n", + " \"\"\"Convert Celsius temperature to Fahrenheit and Kelvin.\n", + "\n", + " Args:\n", + " celsius (float): Temperature in degrees Celsius.\n", + "\n", + " Returns:\n", + " tuple[float, float]: Converted temperatures in Fahrenheit and Kelvin.\n", + " \"\"\"\n", + " fahrenheit = (celsius * 9 / 5) + 32\n", + " kelvin = celsius + 273.15\n", + " return fahrenheit, kelvin\n", + "\n", + "\n", + "# Request user input\n", + "celsius_input = float(input(\"Enter temperature in Celsius: \"))\n", + "\n", + "# Perform conversion\n", + "fahrenheit_output, kelvin_output = celsius_to_fahrenheit_kelvin(celsius_input)\n", + "\n", + "# Display results\n", + "print(f\"\\nInput Temperature: {celsius_input:.2f} °C\")\n", + "print(f\"Converted to Fahrenheit: {fahrenheit_output:.2f} °F\")\n", + "print(f\"Converted to Kelvin: {kelvin_output:.2f} K\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ac301814", + "metadata": {}, "outputs": [], "source": [] } From 15db4d09ddb134912d381f881f259af9204055f8 Mon Sep 17 00:00:00 2001 From: Nathan Makowski Date: Mon, 8 Sep 2025 23:04:21 -0400 Subject: [PATCH 8/9] Create LICENSE --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d7de532 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Department of Climate, Meteorology & Atmospheric Sciences + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From 27538d06dc532285d2b09bd2895217813e2d5e71 Mon Sep 17 00:00:00 2001 From: Nathan Makowski Date: Mon, 8 Sep 2025 23:11:55 -0400 Subject: [PATCH 9/9] Update README.md Updated this section. --- README.md | 44 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9df9ede..9b406a4 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,43 @@ -# Create a README.md +# Temperature Conversion Tool -If you need help with `Markdown`, check out [The Markdown Cheatsheet](https://www.markdownguide.org/cheat-sheet/)! +This project is a simple Python 3 program (developed in Jupyter Notebook) that converts temperatures between **Fahrenheit, Celsius, and Kelvin**. It demonstrates the use of functions, user input, and formatted output while following **PEP 8** (style guide) and **PEP 257** (docstring conventions). -What should a good README.md look like? Check out these [guidelines](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-readmes). +## Features -Did you add an open source software license? \ No newline at end of file +- **Main Branch** + - Converts a user-provided **Fahrenheit** value into Celsius and Kelvin. + +- **Feature Branch** + - Adds functionality to accept a **Celsius** input and convert it to Fahrenheit and Kelvin. + +## Learning Goals + +This project was created as part of a GitHub workflows exercise: +1. Write simple, well-documented Python code. +2. Create a new branch for added functionality. +3. Commit and push changes using GitHub Codespaces. +4. Open a Pull Request (PR) and merge into `main`. + +## Usage + +1. Open the notebook file in your Codespace or local environment. +2. Run the program and enter a temperature value when prompted. +3. The program will display the converted values in the other temperature units. + +Example (Celsius input branch): + +Enter temperature in Celsius: 25 + +Input Temperature: 25.00 °C +Converted to Fahrenheit: 77.00 °F +Converted to Kelvin: 298.15 K + +## Requirements + +- Python 3.8+ +- Jupyter Notebook (optional, if running interactively) + +## License + +This project is licensed under the terms of the **MIT License**. +See the [LICENSE](LICENSE) file for details.