def temperature_convert(inputvalue, inputunits, outputunits):
    """
    Converts temperature from one unit to another.

    Parameters
    ----------
    inputvalue : float
        Input temperature value
    inputunits : string
        Input temperature units:
            c = celsius
            f = fahrenheit
            k = kelvin
    outputunits : string
        Output temperature units:
            c = celsius
            f = fahrenheit
            k = kelvin

    Returns
    -------
    float
        Returns temperature value in required units.
    """
    if inputunits.lower() == "c":
        if outputunits.lower() == "f":
            return (9/5)*inputvalue+32
        elif outputunits.lower() == "k":
            return inputvalue + 273.15
        elif outputunits.lower() == "c":
            return inputvalue
    
    if inputunits.lower() == "f":
        if outputunits.lower() == "c":
            return (5/9)*inputvalue-32
        elif outputunits.lower() == "k":
            return (inputvalue-32) * (5/9)+273.15
        elif outputunits.lower() == "f":
            return inputvalue
    
    if inputunits.lower() == "k":
        if outputunits.lower() == "c":
            return inputvalue - 273.15
        elif outputunits.lower() == "f":
            return (inputvalue-273.15)*(9/5)+32
        elif outputunits.lower() == "k":
            return inputvalue
    units = ["k", "c", "f"]
    
    if inputunits.lower() not in units or outputunits.lower() not in units:
        raise Exception("Enter a valid temperature inputunit or outputunit value. Must be: c, f or k")