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
integerNumber = 64
decimalNumber = 125.59
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!