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