You can download this code by clicking the button below.
This code is now available for download.
Calculate the factorial of a given non-negative integer
Technology Stack : math, random, re, sys, time
Code Type : Function
Code Difficulty : Intermediate
import math
import random
import re
import sys
import time
def factorial(n):
if n == 0:
return 1
else:
return n * factorial(n-1)