There are many ways to write a factorial program in Python. One way is with the help of for loop, and the other is using math.factorial (x), where x denotes the number whose factorial needs to be computed. Thus, you will get the desired output, but if any negative or decimal value is given as input, it will raise an error.