Answers for "how to get factorial python"

3

how to factorise expressions in python

# Python Program to find the factors of a number

# This function computes the factor of the argument passed
def print_factors(x):
   print("The factors of",x,"are:")
   for i in range(1, x + 1):
       if x % i == 0:
           print(i)

num = float(input())

print_factors(num)
Posted by: Guest on April-23-2022
0

find the factorial of a given integer in python

import math
num = 5
print("The factorial of 5 is : ", end="")
print(math.factorial(num))

# output - The factorial of 5 is : 120

# The factorial of a number is the function that multiplies the number by every natural number below it
# e.g. - 1 * 2 * 3 * 4 * 5 = 120
Posted by: Guest on December-20-2021

Code answers related to "how to get factorial python"

Python Answers by Framework

Browse Popular Code Answers by Language