Skip to content

Commit

Permalink
Update Exercício 079.py
Browse files Browse the repository at this point in the history
Added the code and a note about code function
  • Loading branch information
mateusadada committed May 24, 2023
1 parent 396e8a4 commit b64440b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Exercícios resolvidos/Exercício 079.py
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
# Exemplo do problema do fatorial com funções recursivas

def fatorial(n):
if n == 0 or n == 1:
return 1
else:
return n * fatorial(n - 1)


print('Bem vindo ao programa de cálculo de fatorial a partir de uma função recursiva!')
print(f'\nO fatorial de 5 é {fatorial(5)}')

0 comments on commit b64440b

Please sign in to comment.