mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-02-25 10:28:39 +00:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
f94e08df91
commit
a94659c1b0
@ -2,6 +2,7 @@ from __future__ import annotations
|
|||||||
from math import ceil, sqrt
|
from math import ceil, sqrt
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
|
||||||
def timer(func):
|
def timer(func):
|
||||||
def wrapper(*args, **kwargs):
|
def wrapper(*args, **kwargs):
|
||||||
start = time.time()
|
start = time.time()
|
||||||
@ -10,8 +11,10 @@ def timer(func):
|
|||||||
end = time.time()
|
end = time.time()
|
||||||
print(f"{func.__name__} took {end - start:.6f} seconds to execute.")
|
print(f"{func.__name__} took {end - start:.6f} seconds to execute.")
|
||||||
return result
|
return result
|
||||||
|
|
||||||
return wrapper
|
return wrapper
|
||||||
|
|
||||||
|
|
||||||
@timer
|
@timer
|
||||||
def prime_factors(n: int) -> list[int]:
|
def prime_factors(n: int) -> list[int]:
|
||||||
"""
|
"""
|
||||||
@ -109,9 +112,8 @@ def primeproduct(num: int) -> list[int]:
|
|||||||
return prime_factors
|
return prime_factors
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
n = int(input('enter number: '))
|
n = int(input("enter number: "))
|
||||||
primeproduct(n)
|
primeproduct(n)
|
||||||
prime_factors(n)
|
prime_factors(n)
|
||||||
import doctest
|
import doctest
|
||||||
|
Loading…
x
Reference in New Issue
Block a user