Bit_length () #用二进制数表示10进制数时, the minimum number of bits (length) in binary
columns such as:2 in binary notation as0000001010 using bit_ength () means that the length is 1 bits, it will automatically omit the previous 0 Bin (2) in binary notation 2columns such asBin (2)0b10 0b means binary __abs__ take absolute valuecolumns such as: Take the absolute value of threea=-3a.__abs__ ()3An underlined representation of built-in functions in Pythonthe use of built-in functions can be invoked through objects or directlycolumns such as:object, go directly to execute this methoda.__abs__ ()call directly, it will first go to the memory to create this object, and then go to execute this methodABS ( -3) __add__ Increasecolumns such asa=9a.__add__ (1)10 at this time a=10, increased by 1, the direct call is the + number, such as the Plus, the response to the code is add __divmod__ is often used for paging, and once it converts the quotient and remainder of the two divided numbers into a tuple, the remainder can be judged directly.columns such as:a=95b=10cc=a.__divmod__ (b)Print cc(9,5) __eq__ Determines whether two numbers are equal, returns true for equality, does not return false in 2, is the other, and 3 is itcolumns such as:
Aa=18
Bb=19
cc=aa.__eq__ (BB)
Print (CC)
__float__ Conversion of floating-point typescolumns such as: CC conversion for floating-point type
__floordiv__, except for the result of the integer part of the pickup and/or similarcolumns such as: __ge__ judgment greater than equals, equivalent to >=, correct return true, error return falsecolumns such as:
There are a lot of similar things that can be viewed with help to see, many of which can be represented by operator +-*/There is rdivmod many similar, in fact, the function is the same as the front, but it changed from right to left operation, run from left to right to usecolumns such as
Python Inside int function introduction