PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# you can import factorial from math or use import math by itself
# example 1
from math import factorial
print(factorial(5)) # Output: 120
# example 2
import math
# Now you can use the factorial function
result = math.factorial(5)
print(result) # Output: 120
# example 3
print(5*4*3*2*1) # Output: 120
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run