Skip to content

Commit 27cf621

Browse files
authored
Update time_algo_exec.py
Fixing doctest problem
1 parent f8f7ed1 commit 27cf621

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

other/time_algo_exec.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ def calc(operations: dict) -> float:
1818
an operation is performed and its execution time, and the key should,
1919
preferably, be the name of the operation for better clarity and usability.
2020
:return: the time needed for the execution of this algorithm
21-
#>>> operations1 = {"addition":(2, 0.1), "subtraction":(1, 0.2)}
22-
#>>> operations2 = {"addition":(2, 0.1), "subtraction":(1, 0.2, 1)}
23-
#>>> calc(operations1)
24-
#>>> 0.4
25-
#>>> calc(operations2)
26-
#>>> 0
21+
>>> operations1 = {"addition":(2, 0.1), "subtraction":(1, 0.2)}
22+
>>> operations2 = {"addition":(2, 0.1), "subtraction":(1, 0.2, 1)}
23+
>>> calc(operations1)
24+
>>> 0.4
25+
>>> calc(operations2)
26+
>>> 0
2727
"""
2828
temps = 0
2929
for couple in operations.values():
@@ -40,7 +40,3 @@ def calc(operations: dict) -> float:
4040
import doctest
4141

4242
doctest.testmod()
43-
operations1 = {"addition": (2, 0.1), "subtraction": (1, 0.2)}
44-
operations2 = {"addition": (2, 0.1), "subtraction": (1, 0.2, 1)}
45-
print(calc(operations1))
46-
print(calc(operations2))

0 commit comments

Comments
 (0)