Skip to content

Commit 2efb81b

Browse files
committed
BRUSHED:2
1 parent 2655f72 commit 2efb81b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

my_exercises/question_2.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,13 @@
1919
# Hints:
2020
# In case of input data being supplied to the question, it should be assumed to be a console input.
2121
#
22-
################################################################
22+
################################################################
23+
24+
from functools import reduce
25+
26+
input_str: str = input('input an integer: ')
27+
28+
n: int = int(input_str)
29+
result: int = reduce(lambda a, b: a * b, range(1, n+1))
30+
31+
print(result)

0 commit comments

Comments
 (0)