From 0c3598663c9c33bf7bf0bf16b7e2090fb5e99595 Mon Sep 17 00:00:00 2001 From: "exercism-solutions-syncer[bot]" <211797793+exercism-solutions-syncer[bot]@users.noreply.github.com> Date: Tue, 12 Aug 2025 03:04:19 +0000 Subject: [PATCH] [Sync Iteration] python/square-root/1 --- solutions/python/square-root/1/square_root.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 solutions/python/square-root/1/square_root.py diff --git a/solutions/python/square-root/1/square_root.py b/solutions/python/square-root/1/square_root.py new file mode 100644 index 0000000..d830970 --- /dev/null +++ b/solutions/python/square-root/1/square_root.py @@ -0,0 +1,16 @@ +"""Solution for Square Root.""" + +from math import sqrt + + +def square_root(number: float) -> int: + """ + Calculate square root. + + :param number: any number + :type number: float + :return: square root of any number, + only natural numbers (positive integers) as solutions. + :rtype: int + """ + return int(sqrt(number))