# -*- coding: utf-8 -*-
"""
Created on Tue Oct 20 13:55:41 2020

@author: Supriyo
"""
#iterative version
def factorial(num):
    product=1
    for i in range(1,num+1):
        product=product*i
    return product

num=int(input("enter a number "))
if num<0:
    print("negetive number is not allowed")
else:
    f=factorial(num)
    print("factorial of ", num," is ",str(f))

   
31f122e64ed347a0b9ccc00c70e484ef8b51f0f1
<mask token>

<mask token>


def factorial(num):
    product = 1
    for i in range(1, num + 1):
        product = product * i
    return product


<mask token>

<mask token>


def factorial(num):
    product = 1
    for i in range(1, num + 1):
        product = product * i
    return product


<mask token>
if num < 0:
    print('negetive number is not allowed')
else:
    f = factorial(num)
    print('factorial of ', num, ' is ', str(f))

<mask token>


def factorial(num):
    product = 1
    for i in range(1, num + 1):
        product = product * i
    return product


num = int(input('enter a number '))
if num < 0:
    print('negetive number is not allowed')
else:
    f = factorial(num)
    print('factorial of ', num, ' is ', str(f))

# -*- coding: utf-8 -*-
"""
Created on Tue Oct 20 13:55:41 2020

@author: Supriyo
"""
#iterative version
def factorial(num):
    product=1
    for i in range(1,num+1):
        product=product*i
    return product

num=int(input("enter a number "))
if num<0:
    print("negetive number is not allowed")
else:
    f=factorial(num)
    print("factorial of ", num," is ",str(f))

   