Calculating Square Root in Python

Python Calculate Square Root

This is a quick tutorial to find the square root of a number in python. Calculate the square root using the inbuilt math module in a single line of code.

Python comes with a math module. All you need to do is to just import this module and then you can use the object sqrt(). The number for which you want to calculate the square root has to be put inside it as a parameter.

The following example illustrates the use of the object sqrt()of the math module.

Python Square Root Calculation Example

So, this way you can easily calculate Square Root of any number using the inbuilt math module. I hope you found this guide useful. If so, do share it with others who are willing to learn Python. If you have any questions related to this article, feel free to ask us in the comments section.

And do not forget to subscribe to WTMatter!

Subscribe To WTMatter!

Receive updates of our latest articles via email. Enter your email address below to get started.

Leave a Reply

Your email address will not be published. Required fields are marked *