factorial()

factorial is the product of all the positive integers less than or equal to input number.
!n is also denoted as factorial of a number .
import math
print(math.factorial(4))    # 24
factorial of 4 is 24.
import math
print(math.factorial(12))    # 479001600
Factorial of a number without using the factorial() function
n=12
factorial=1
for i in range (1,n+1):
    factorial=factorial * i
print(factorial)
Output is here
479001600


plus2net.com



Post your comments , suggestion , error , requirements etc here




We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
©2000-2020 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer