Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

How to perform square root without using math module in Python?

How to perform square root without using math module in Python?                                


1 Answer
Jayashree

Python has exponentiation operator (**) which can be used to calculate power of a number. x**y returns x raised to y i.e. y times multiplication of x. Since we need to calculate square root, y should be (1/2)

>>> 10**(1/2)
3.1622776601683795
>>> 25**(1/2)
5.0
Advertisements

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.