Python Data Type III

Source: Internet
Author: User
Tags function prototype

First, help

 If you want to know more about an object, you can call Help (object)! There are also some useful ways that Dir (object) will display most of the relevant property names for that object, and Object._ Doc _ will display its corresponding document string

1.help ()

The Help function is a built-in function of Python. Function prototype: Help ([Object]). As shown below:

2.dir ()

The Dir function is a built-in function of Python. Function prototype: dir ([Object]). Can help us get most of the related properties of the object. As shown below

 

3. You can also CTRL + the left mouse button to view the source code. The type () function can view the data type

Second, forced conversion

  

Function Describe
int (x [, Base]) Converts x to an integer (where base represents cardinality)
Long (x [, Base]) Convert x to a long integer
Float (x) Convert x to a floating-point number
Complex (real [, Imag]) Create a complex number
STR (x) Convert an object x to a string
REPR (x) Convert an object x to an expression string
eval (str) Used to evaluate a valid Python expression in a string and return an object
Tuple (s) Converting a sequence s to a tuple
List (s) Convert the sequence s to a list
Chr (x) Converts an integer to one character
UNICHR (x) Converts an integer to a Unicode character
Ord (x) Converts a character to its integer value
Hex (x) Converts an integer to a hexadecimal string
Oct (x) Converts an integer to an octal string

Python Data Type III

Related Article

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.