Excel in math, science, and engineering

New user? Sign up

Existing user? Sign in

Do the following snippets of code always return the same output given a positive integer input?

1 2 3 4 5

def factorial(n): factorial = 1 for number in range (1, n): factorial = factorial * number return factorial

def factorial(n): if n == 1 : return 1 else: return n*factorial(n-1)

Problem Loading...

Note Loading...

Set Loading...