Python type conversion function description int (x [, base]) converts x to an integer long (x [, base]) and converts x to a long integer float (x) convert x to a floating point complex (real [, imag]) to create a plural str (x )...
Function description int (x [, base]) converts x to an integer long (x [, base]) and converts x to a long integer float (x) convert x to a floating point complex (real [, imag]) to create a plural str (x). Convert x to a string repr (x) convert object x to expression string eval (str) to calculate a valid Python expression in the string, and return an object tuple (s) to convert the sequence s to a list (s) converts the sequence s to a list chr (x) and an integer to a character unichr (x). converts an integer to a Unicode character ord (x) convert a character to its integer hex (x) and convert an integer to a hexadecimal string oct (x). convert an integer to an octal string.
The sequence supports the following operations:
Operation description: the s + r sequence is connected to n copies of s * n, n * s, and n is an integer s % d. The string is formatted (only a string) s [I] Index s [I: j] slice x in s, x not in s subordination for x in s: iteration len (s) length min (s) the smallest element max (s) the largest element s [I] = x is s [I] re-assigned s [I: j] = r: assign the list fragment value del s [I] again to delete an Element del s [I: j] in the list and delete a fragment in the list.
Numeric operation:
X <y shifts left x> y shifts right x & y by bit and x | y by bit or x ^ y by bit or (exclusive or )~ X flip x + y plus x-y minus x * y multiply x/y conventional division x // y floor Division x ** y multiplication (xy) x % y modulo (x mod y)-x changes the symbol bit of the operand + x does nothing ~ X ~ X =-(x + 1) abs (x) absolute value pmod (x, y) returns (int (x/y), x % y) pow (x, y [, modulo]) returns (x ** y) x % moduloround (x, [n]) rounded, n is the number of decimal places x <y is less than x> y is greater than x = y is equal to x! = Y is not equal to (and) x> = y is greater than or equal to x <= y is less than or equal