import math


def normpdf(x, mu, sigma):
    """
    Function to calculate the probability density function of normal distribution
    Parameters : 
        x(float):- x value
        mu(float):- mu of normal distribution
        sigma(float):- sigma of normal distribution
    Return : 
        float:- probability density function of normal distribution at x point
    """
    if(sigma == 0):
        sigma = float('inf')
    try:
        sigma = float(sigma)
        x = float(x)
        mu = float(mu)
    except ValueError:
        print('x, mu or sigma are not all numeric')
        exit()
    else:
        denom = (2 * math.pi)**.5 * sigma
        num = math.exp(-(float(x) - float(mu))**2 / (2 * sigma**2))
        return(num / denom)