I don't understand the difference between return and print. I was told that you should use return in function statements but it doesn't return anything, so I've been using print in my functions. But I want to understand why return statements in my functions do not work.
def triangle_area(b, h):
return 0.5 * b * h
triangle_area(20, 10)
I would expect this return the multiplication, but it doesn't yield anything. Please help! And when I replace the return with print, it works perfectly. Am i supposed to use print in functions?