def percent_of ( percent , whole ) : percent = float ( percent ) whole = float ( whole ) return ( percent * whole ) / 100
how to make a number a percent python
Calculates the value of a percent of a number ie : 5% of 20 is what -- > 1 Args : percent ( float ) : The percent of a number whole ( float ) : The whole of the number Returns : float : The value of a percent Example : >>> percent_of ( 25 100 ) 25 . 0 >>> percent_of ( 5 20 ) 1 . 0
def percent_of(percent, whole):
    """Calculates the value of a percent of a number
    ie: 5% of 20 is what --> 1
    
    Args:
        percent (float): The percent of a number
        whole (float): The whole of the number
        
    Returns:
        float: The value of a percent
        
    Example:
    >>> percent_of(25, 100)
    25.0
    >>> percent_of(5, 20)
    1.0
    
    """
    percent = float(percent)
    whole = float(whole)
    return (percent * whole) / 100