From a94659c1b0854f67c68cc72834a7de52c6d2fa0d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 6 Aug 2023 16:08:00 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- maths/prime_factors.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/maths/prime_factors.py b/maths/prime_factors.py index e7a523be0..fdbea6ae4 100644 --- a/maths/prime_factors.py +++ b/maths/prime_factors.py @@ -2,6 +2,7 @@ from __future__ import annotations from math import ceil, sqrt import time + def timer(func): def wrapper(*args, **kwargs): start = time.time() @@ -10,8 +11,10 @@ def timer(func): end = time.time() print(f"{func.__name__} took {end - start:.6f} seconds to execute.") return result + return wrapper + @timer def prime_factors(n: int) -> list[int]: """ @@ -109,9 +112,8 @@ def primeproduct(num: int) -> list[int]: return prime_factors - if __name__ == "__main__": - n = int(input('enter number: ')) + n = int(input("enter number: ")) primeproduct(n) prime_factors(n) import doctest