How to make factorial of a number in python? Learning Python - 6th Night - 2

 Use this function to get factorial of a number x

def fact(x):
for i in range(1,x):
x *= i
return x

print(fact(6))

Comments

Popular posts from this blog

Apple iPad Air (2022) Specifications and Review in 2023

17-year-old suspect in fatal stabbing at Taylor Swift-themed dance event ID’d

Learning Python - 7th Day (Night - 2)