Ad
Code
Diff
  • def factorial(n): 
        if n == 0: 
            return 1 
        else: 
            recurse = factorial(n-1) 
            result = n * recurse 
            return result
    
    # thats how i learned it from "think python"
    • def factorial(n):
    • # your code goes here
    • return
    • def factorial(n):
    • if n == 0:
    • return 1
    • else:
    • recurse = factorial(n-1)
    • result = n * recurse
    • return result
    • # thats how i learned it from "think python"