Is it possible to calculate a square root of an expression in python ?
For example , the square root of: (a^4 - 8a^2 -16a + 16)
?
Of course the result will be with a
, not a numeric value.
I read about math.sqrt() and tried doing this , but pycharm insisted that i would assign a value into a .
import math
a = 16
b = math.sqrt(a**4 - 8*(a**2) -16*a +16 )
print b
this code works , but I do not want to assign into a , I want an expression as a result .