First time here? Check out the FAQ!
answered 8 years ago
If you check the type of h with type(h), it comes back as
h
type(h)
<type 'sage.symbolic.expression.Expression'>
which is not numeric but symbolic. You can convert it to a numeric value with n(h) or h.n() and then the substitution will give zero as expected.
n(h)
h.n()