From 1ebad3f9b809e8601c4f79ef4032a0be15ebef2f Mon Sep 17 00:00:00 2001 From: KomalKumar123 <149494754+KomalKumar123@users.noreply.github.com> Date: Mon, 11 Aug 2025 15:19:33 +0530 Subject: [PATCH 1/2] V2 --- version2_keyboard_input.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 version2_keyboard_input.py diff --git a/version2_keyboard_input.py b/version2_keyboard_input.py new file mode 100644 index 0000000..72f6960 --- /dev/null +++ b/version2_keyboard_input.py @@ -0,0 +1,6 @@ +a = float(input("Enter coefficient a: ")) +b = float(input("Enter coefficient b: ")) +c = float(input("Enter coefficient c: ")) +t = float(input("Enter time t (hour/day): ")) +T = a * t**2 + b * t + c +print(f"Predicted temperature at t={t}: {T:.2f}°C") From 803b15acfa2fd806479c4b15c733b4a59076724f Mon Sep 17 00:00:00 2001 From: KomalKumar123 <149494754+KomalKumar123@users.noreply.github.com> Date: Mon, 11 Aug 2025 15:21:33 +0530 Subject: [PATCH 2/2] V3 --- inputs_single1.txt | 4 ++++ version3_file_input_single.py | 10 ++++++++++ 2 files changed, 14 insertions(+) create mode 100644 inputs_single1.txt create mode 100644 version3_file_input_single.py diff --git a/inputs_single1.txt b/inputs_single1.txt new file mode 100644 index 0000000..ac63bbc --- /dev/null +++ b/inputs_single1.txt @@ -0,0 +1,4 @@ +0.3 +-2.5 +26 +4 \ No newline at end of file diff --git a/version3_file_input_single.py b/version3_file_input_single.py new file mode 100644 index 0000000..19d848b --- /dev/null +++ b/version3_file_input_single.py @@ -0,0 +1,10 @@ +with open("inputs_single1.txt", "r") as f: + lines = f.readlines() + +a = float(lines[0]) +b = float(lines[1]) +c = float(lines[2]) +t = float(lines[3]) + +T = a * t**2 + b * t + c +print(f"Predicted temperature at t={t}: {T:.2f}°C")