From a8a3f672c9a7137957b78afa76050dc0608e0982 Mon Sep 17 00:00:00 2001 From: Marlon Nunez Date: Sat, 14 Mar 2026 20:24:02 -0500 Subject: [PATCH 1/2] Added a percentage alogrithm --- maths/percentage_calculator.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 maths/percentage_calculator.py diff --git a/maths/percentage_calculator.py b/maths/percentage_calculator.py new file mode 100644 index 000000000000..7ecc1c67d6bc --- /dev/null +++ b/maths/percentage_calculator.py @@ -0,0 +1,10 @@ +def calculate_percentage(value, percent): + return (value * percent) / 100 + + +value = float(input("Enter value: ")) +percent = float(input("Enter percentage: ")) + +result = calculate_percentage(value, percent) + +print("Result:", result) \ No newline at end of file From d31dfe9fdf9f1d969a068e9e5d0325135aeb6206 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 15 Mar 2026 01:28:24 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- maths/percentage_calculator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maths/percentage_calculator.py b/maths/percentage_calculator.py index 7ecc1c67d6bc..b18666a30e07 100644 --- a/maths/percentage_calculator.py +++ b/maths/percentage_calculator.py @@ -7,4 +7,4 @@ def calculate_percentage(value, percent): result = calculate_percentage(value, percent) -print("Result:", result) \ No newline at end of file +print("Result:", result)