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/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") 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")