在另一个函数中使用一个函数时,如何解决此语法错误?

时间:2019-04-26 03:36:18

标签: python-3.x

我试图弄清楚如何在另一个函数中调用该函数,但是我无法在“ t_calc = calc_temp(d_curr,volt,tbase)”行上解决此无效的语法错误。您不能在另一个函数中调用一个函数吗?

def calc_temp(current,voltage,tbase):
    power_diss = current * voltage
    thermal_resistance = THICK/(K*AREA)
    temp = tbase + (power_diss * thermal_resistance)
    return(temp)


def diode_i_terr(volt,tguess,tbase):
    d_curr = I0(np.exp((Q*volt)/(IDE*KB*tguess))
    t_calc = calc_temp(d_curr,volt,tbase)
    t_err = t_calc - tguess
    return(d_curr, t_err)



    t_calc = calc_temp(d_curr,volt,tbase)
         ^
SyntaxError: invalid syntax

0 个答案:

没有答案