0

# Function Maths

Hello everyone I hope all is well. I was wondering whether it is possible to simple mathematics with functions. so for example: def Slope(): slope = (max(Log) - min(Log))/(max(Temperature) - min(Temperature)) print(slope) Slope() def Ea(): Ea = (Slope() * Gas_constant)/1000 #Divide it by thousand to get it into KJ mol-1 print(Ea) Ea() can I do Slope() * Gas_constant? I have a feeling it is not possible and I think I know the reason why but maybe someone could prove me wrong. Thanks everybody

2 Answers

+ 2

yes.. instead of
def Slope():
slope = (max(Log) - min(Log))/(max(Temperature) - min(Temperature))
print(slope)
..do...
def Slope():
slope = (max(Log) - min(Log))/(max(Temperature) - min(Temperature))
print(slope)
return slope

0

Thank you very much Rod, much appreciated.