I am having trouble printing a variable that is inside a function. I have tried returning the variable, making the variable a global variable, and yet nothing. What should I do? I don't know how to proceed from here. Below is my code:
import cmath
newInput = raw_input()
dim1, dim2, dim3 = newInput.split()
float(dim1)
float(dim2)
float(dim3)
def sFinder():
s2 = dim1 + dim2 + dim3
s1 = float(s2) / 2
s = float(s1)
float(s)
return s
def heron():
ans2 = s((s-dim1)(s - dim2)(s - dim3))
ans = sqrt(ans2)
return ans
print ans

New Topic/Question
Reply



MultiQuote





|