Python built-in functions

Source: Internet
Author: User

#ABS seek absolute valuePrint(ABS (-1))# All#determine the Boolean value inside the function, and return True if both are Trun#Null is TruePrint(All ([1, 2,'a', None]))Print(All ([]))#bool value is false: None, empty, 0,false# any#returns True if the Boolean value inside the function has any one of the values true#Null is FalsePrint(Any ([]))Print(Any ([' ', None,false]))#TruePrint(Any (["', None,false]))#FalsePrint(Any (["', none,false,1]))#True#Bin,oct,hex#represents return binary returns octal returns hexadecimalPrint(Bin (10))#0b OpeningPrint(Oct (10))#0o OpeningPrint(Hex (10))#0x opening#bytes#Convert a string to a bytes type#Unicode----encode----->bytesPrint('Hello'. Encode ('Utf-8'))Print(Bytes ('Hello', encoding='Utf-8'))#callable#to see if an object is a callable objectPrint(callable (bytes))Print(callable (ABS))#Chr,ord#CHR prints the characters corresponding to the numbers in the ASCII code#Ord Print the number of characters in ASCIIPrint(Chr (65))Print(Chr (90))#Print(Ord ('#'))

Python built-in functions

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.