-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEX47W.py
More file actions
22 lines (17 loc) · 716 Bytes
/
EX47W.py
File metadata and controls
22 lines (17 loc) · 716 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
n = int(input("Digite o valor de n: "))
while (n <= 0): n = int(input("Informe somente valores positivos: "))
fatorial = 1
m = 2
while (m <= n):
fatorial = fatorial*m
m = m + 1
if (m - 1 == n):
print(f"O valor de {n}! é = {fatorial}")
resposta = input("\nDeseja executar o programa novamente? 'SIM' ou 'NAO': ")
while (resposta != 'SIM' and resposta != 'NAO'):
resposta = input("Deseja executar o programa novamente? 'SIM' ou 'NAO': ")
if (resposta == 'SIM'):
m = 2
fatorial = 1
n = int(input("Digite o valor de n: "))
while (n <= 0): n = int(input("Informe somente valores positivos: "))