Skip to content

Commit ff1a327

Browse files
committed
question_2 = fatorial
1 parent c99c263 commit ff1a327

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

anwers/lvl_1/question_2.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,12 @@
88

99
# Hints:
1010
# In case of input data being supplied to the question, it should be assumed to be a console input.
11+
12+
# fatorial = 8! = 8x7x6x5x4x3x2x1 = 40320
13+
numero = int(input('Digite um número para calcular seu fatorial: '))
14+
fatorial = 1
15+
16+
for n in range(1, numero + 1):
17+
fatorial *= n
18+
19+
print("O resultado de {0}! é: {1}".format(numero, fatorial))

0 commit comments

Comments
 (0)