YouTip LogoYouTip

Python3 Func Number Abs

# Python3.x Python3 abs() Function [![Image 3: Python3 Numbers](#) Python3 Numbers](#) * * * ## Description The abs() function returns the absolute value of a number. * * * ## Syntax Here is the syntax for the abs() method: abs( x ) * * * ## Parameters * x -- A numeric expression, which can be an integer, float, or complex number. * * * ## Return Value The function returns the absolute value of x (a number). If the argument is a complex number, it returns its magnitude. * * * ## Example The following example demonstrates the use of the abs() method: ## Example #!/usr/bin/python3 print("abs(-40) : ",abs(-40)) print("abs(100.10) : ",abs(100.10)) The output of the above example is: abs(-40) : 40 abs(100.10) : 100.1 **Related Article: [Difference between Python fabs() and abs()](#)*Python3 Numbers](#)
← Python3 Func Number AbsPython Command Line Arguments β†’