YouTip LogoYouTip

Python3 Func Number Sqrt

Python3 sqrt() Function | Tutorial

Python3 sqrt() Function | Tutorial

Tutorial -- Learning is not just about technology, but also about dreams!

Python 3 Tutorial

Python3 Tutorial Python3 Introduction Python3 Environment Setup Python3 VScode Python3 Basic Syntax Python3 Basic Data Types Python3 Data Type Conversion Python3 Interpreter Python3 Comments Python3 Operators Python3 Numbers Python3 Strings Python3 Lists Python3 Tuples Python3 Dictionaries Python3 Sets Python3 Conditional Statements Python3 Loops Python3 First Program Python3 Comprehensions Python3 Iterators & Generators Python3 with Python3 Functions Python3 lambda (Anonymous Functions) Python Decorators Python3 Data Structures Python3 Modules Python __name__ Python3 Input & Output Python3 File Python3 OS Python3 Errors & Exceptions Python3 Object-Oriented Python3 Namespace/Scope Creating Python Virtual Environments Python Type Hints Python3 Standard Library Overview Python3 Examples Python Quiz

Python3 Advanced Tutorial

Python3 Regular Expressions Python3 CGI Programming Python MySQL - mysql-connector Driver Python3 MySQL Database Connection - PyMySQL Driver Python3 Network Programming Python3 SMTP Sending Email Python3 Multithreading Python3 XML Processing Python3 JSON Data Parsing Python3 Date & Time Python3 Built-in Functions Python MongoDB Python3 urllib Python uWSGI Installation & Configuration Python3 pip Python3 operator Module Python math Module Python requests Module Python random Module Python OpenAI Python Useful Resources Python AI Drawing Python statistics Module Python hashlib Module Python Quantitative Python pyecharts Module Python selenium Library Python Web Scraping - BeautifulSoup Python Scrapy Library Python Markdown to HTML Python sys Module Python Pickle Module Python subprocess Module Python queue Module Python StringIO Module Python logging Module Python datetime Module Python re Module Python csv Module Python threading Module Python asyncio Module Python PyQt Python for Loop Python while Loop

Python3 Operators Python3 Strings

Explore

Scripts

Development Tools

Scripting Languages

Web Service

Software

Programming

Programming Languages

Web Design & Development

Web Services

Computer Science

Python3.x Python3 sqrt() Function

Python3 Numbers Python3 Numbers


Description

The sqrt() method returns the square root of the number x.


Syntax

Here is the syntax for the sqrt() method:

import math
math.sqrt( x )

Note: sqrt() cannot be accessed directly; you need to import the math module and call the method via a static object.


Parameters

  • x -- A numeric expression.

Return Value

Returns the square root of the number x.


Example

The following example demonstrates the use of the sqrt() method:

Example

#!/usr/bin/python3
import math  # Import the math module
print("math.sqrt(100) : ", math.sqrt(100))
print("math.sqrt(7) : ", math.sqrt(7))
print("math.sqrt(math.pi) : ", math.sqrt(math.pi))

After running the above example, the output is:

math.sqrt(100) : 10.0
math.sqrt(7) : 2.6457513110645907
math.sqrt(math.pi) : 1.7724538509055159

Python3 Numbers Python3 Numbers

← Python3 Func Number RandrangePython3 Func Number Sqrt β†’