Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- def Factorial(n):
- if n<2:
- return 1
- return n*Factorial(n-1)
- def FactorialTest(n,x):
- i = 0
- while i<x:
- print(" ",end="")
- i+=1
- print("n = ",n)
- if n<2:
- return 1
- return n*FactorialTest(n-1,x+1)
- def FactoriaLux(n):
- return n*FactorialTest(n,0)
- def Fibbo(n):
- if n<3:
- return 1
- return Fibbo(n-1) + Fibbo(n-2)
- def Fibbo1(n):
- if n<3:
- return 1
- return Fibbo1(n-1) + Fibbo1(n-2)
- def Main():
- n = int(input("n? = "))
- print("%d! = %d"%(n,FactoriaLux(n)))
- print("Fibbo(%d) = %d"%(n,Fibbo(n)))
- Main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement