Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- # -*- coding: utf-8 -*-
- def fat(valor):
- if valor == 1 or valor == 0:
- return 1
- else:
- return valor * fat(valor - 1)
- numero = int(raw_input("Entre com um número: "))
- print "O fatorial desse número é:", fat(numero)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement