Python path 18 built-in function

Source: Internet
Author: User

1. ABS (number) indicates the absolute value of a digit

Print # Print out 123

2, All (iterable) indicates that the iterated parameters are all true then return true, otherwise false

# The argument is iterative and returns true if the argument is all true, otherwise false Print (RE)  # True

The case of False in Python: False,0,none, ', [], (), {},set (), other true, can be verified with a bool conversion, for example:

BOL = bool (set ())print (BOL)  # Print False
Re = All (['aa', (11,22), {}])print(re)  #  Because there is a {} in the above parameter so that one of them is false, the result prints false

3. Any (iterable) indicates that the parameter of the iteration can return true if one is true, otherwise it returns false.

Re = any ([', (), [],{}])Print# because the parameters are all false, the result prints false

4, ASCII (object) #表示在对象的类中找到__repr__, executes __repr__ and returns the returned result to ASCII, and returns it back by ASCII

class Foo:     def __repr__ (self):         return ' Hello world! '  = Foo ()  # class instantiation print(FO)  # output ' Hollo world! '

Python path 18 built-in function

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.