def fibonacci(n): current = 1 next = 1 for i in range(n): nextNext = current + next next = nextNext current = next return current def factorial(n): result = 1 for i in range(n): result *= i return result def analyze(n): x = fibonacci(n) y = factorial(n) if x > y: result = "Factorial " + str(n) + " (" + str(y) + ") is greater than " + str(n) + "th fib. number (" + str(x) + ")" else: result = "Factorial " + str(n) + " (" + str(y) + ") is equal or less than " + str(n) + "th fib. number (" + str(x) + ")" return result inputVal = 6 xString = str(inputVal) introString = "Program will compare " + xString + "! and " + xString + "th fibonacci number" print(introString) resultString = analyze(inputVal) print(resultString)