Python functions-abs ()

Source: Internet
Author: User
Python functions-abs () from today on, I will update a python function every day, with notes for using instances and functions. I gave this function topic the name "python function one talk every day". I hope you can support it. Haha


Starting from below, today's function is abs ()


Read the official English document for explanation.


Abs (x)

Return the absolute value of a number. The argument may be a plain or long integer or a floating point number. If the argument is a complex number, its magnitude is returned.


Details:

Returns the absolute value.


The parameter can be a negative number, a positive number, a floating point number, or a long integer.


Instance:

Abs (-1.2) # returns 1.2 abs (1.2) # returns 1.2 abs (-11216.5) # returns 11216.5 abs (11216.5) # returns 11216.5 abs () # returns


Note: the parameter can be a negative number or a positive number. Only the absolute value is obtained, and no integer is obtained.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.