Method 1: use the built-in module
>>> import math
>>> math.pow(12, 2) # Request Square
144.0
>>> math.sqrt(144) # Find the square root
12.0
>>>
Method 2: use expression
>>> 12 ** 2 # Request Square
144
>>> 144 ** 0.5 # Find the square root
12.0
>>>
Method 3: use built-in function
>>> pow(12, 2) # Request Square
144
>>> pow(144, .5) # Find the square root
12.0
>>>
Read More:
- Python+OpenCV: How to Use Background Subtraction Methods
- How to Solve Python Importerror: DLL load failed: unable to find the specified program using tensorflow
- An introduction to sys modules in Python and how packages are imported and used
- How to Fix keyerror in Python dictionary lookup
- [Solved] Python Error: tensorflow.python.framework.errors_impl.UnknownError: 2 root error(s) found.
- How to Solve Python ImportError: cannot import name UnrewindableBodyError
- Importerror: DLL load failed: unable to find the specified module in Python
- How to Solve Python WARNING: Ignoring invalid distribution -ip (e:\python\python_dowmload\lib\site-packages)
- Python recursively traverses all files in the directory to find the specified file
- [Solved] torchvision Error: UserWarning: Failed to load image Python extension: Could not find module
- How to Fix “HTTP error 403: forbidden” in Python 3. X
- Jupyter notebook Failed to Switch to the Virual Environment: DLL load failed python.exe could not find the entry
- Python: How to Disable InsecureRequestWarning error
- Python: How to get the size of the picture (byte/kb/mb)
- How to Solve Python AttributeError: ‘module’ object has no attribute ‘xxx’
- Python: How to Obtaining Publick IP Quickly
- Python: How to Auto Add Watermark to PDF
- How to Solve Python AttributeError: ‘dict’ object has no attribute ‘item’
- npm install Error: stack Error: Can’t find Python executable “python”
- Python: How to parses HTML, extracts data, and generates word documents