As well he should
Here's what wooee means:
def SD():
b = []
for n in range(r-1):
if r[n] > a:
b.append((r[n] - a)**2)
if r[n] < m:
b.append((a - r[n])**2)
SD = (float(b)/r)**0.5 #float because the data includes decimal values
return SD
print "The standard deviation is", SD
Note that "SD" is a function. So when you print the function, you get, quite literally, the function: <function SD" at 0x020EB630>
Try this with a simpler example:
def MyFunc():
pass
print MyFunc
What you actually want to print is the result of calling the function. So that needs this:
def SD(...):
....
print SD()
The extra () mean "call the function and accept the result."
Mathematical aside: Your test 'if r[n] < a' is superfluous. For any values of r[n] and a, it will be true that
(r[n] - a) ** 2 == (a - r[n]) ** 2
which is why standard deviations are calculated using square residues in the first place (so that under- and over-values don't cancel each other out).
Jeff