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

22nd Dec 2019, 6:03 PM
Mars_96
2 Antworten
+ 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
22nd Dec 2019, 6:17 PM
rodwynnejones
rodwynnejones - avatar
0
Thank you very much Rod, much appreciated.
22nd Dec 2019, 6:23 PM
Mars_96