To avoid calculating the square root in Python

Asked 1 years ago, Updated 1 years ago, 123 views

I'm making some kind of equation. But it's hard to see because the square roots in the equation are calculated and printed out.How can I prevent the square root from being calculated? I hope the square root is not calculated and is output in the form of 2** (0.5)...

python calculate

2022-09-21 21:08

1 Answers

The questionnaire seems to have entered the programming.

You can make it represented as a string instead of being calculated.

In other words, even if it's an arithmetic expression, if the property is a string, it doesn't do the calculation

print("2**(0.5)", 2**(0.5))
2**(0.5) 1.4142135623730951

It can be expressed as above.


2022-09-21 21:08

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.