is there a way to output a square root in a square root form instead of a read number with python?

144 Views Asked by At

there are a lot of tools could be used to compute square roots.

for instance, with Python NumPy

np.sqrt(80)

outputs

8.94427190999916

is there a way (or a 3rd party package) to have

sqrt(80)

output

$4\sqrt{5}$

1

There are 1 best solutions below

0
On BEST ANSWER

sympy could meet your need

sqrt(80)

outputs $4\sqrt{5}$

enter image description here