We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4226641 commit a2b2951Copy full SHA for a2b2951
maths/sum_of_digits.py
@@ -1,6 +1,7 @@
1
from collections.abc import Callable
2
from timeit import timeit
3
4
+
5
def sum_of_digits(n: int) -> int:
6
"""
7
Find the sum of digits of a number.
@@ -56,6 +57,7 @@ def benchmark() -> None:
56
57
58
Benchmark multiple functions, with three different length int values.
59
60
61
def benchmark_a_function(func: Callable, value: int) -> None:
62
call = f"{func.__name__}({value})"
63
timing = timeit(f"__main__.{call}", setup="import __main__")
0 commit comments