Calculate the factorial of a number

 num = 5

factorial = 1

for i in range(1, num + 1):

    factorial *= i

print("The factorial of", num, "is", factorial)


Comments

Popular posts from this blog

Simple Python Program Code for Snake Game

Iris Flowers Classification ML Project with Code

Data exploration and scatter plot visualization in Python using Pandas and Matplotlib