In sympy, I want to create a constant e.g. to represent the speed of light.
Thus I initialize c
with the keyword constant=True
.
Later I want to check, if a symbol is a constant or a variable.
Unexpectedly the command c.is_constant()
outputs False.
c = Symbol( 'c' , constant=True, real=True )
c.is_real # outputs True as expected.
c.is_constant() # outputs False. This is unexpected !
How can I check, if a symbol is a constant or a variable ?