Introduction to the functions of int in Python

Source: Internet
Author: User

Introduction to the function of int
1. Absolute value x.__abs__ () is equivalent to ABS (x) 2. Addition X.__add__ (y) is equivalent to X+y3. and the Operation x.__and__ (y) is equivalent to X&y4. Boolean Operation X.__bool__ () 5. Quotient and remainder x.__divmod__ (y) are equivalent to Divmod (x, y) 6. equals x.__eq__ (y) is equivalent to X==y7. integers to floating-point x.__float__ () are equivalent to float (x) 8. The floor except x.__floordiv__ (y) is equivalent to X//y9. Greater than or equal to x.__ge__ (y) is equivalent to X>=y10. Greater than x.__gt__ (Y) is equivalent to X>y11. The construction Method x.__init__ () is equivalent to int (x) 12. Less than or equal to x.__le__ (y) is equivalent to X&LT;=Y13. The left shift x.__lshift__ (y) is equivalent to x<<214. Less than x.__lt__ (y) is equivalent to X&LT;Y15. Modulo x.__mod__ (y) is equivalent to X%Y16. Multiplication x.__mul__ (y) is equivalent to X*Y17. Not equal to x.__ne__ (y) equals to X!=y18. A negative number x.__neg__ () is equivalent to-x19. or operation X.__or__ (y) is equivalent to X|y20. A positive x.__pos__ () is equivalent to +x21. A power x.__pow__ (y) is equivalent to X**y22. Right-to-left addition x.__radd__ (y) is equivalent to y+x23. Right-to-left and operation X.__rand__ (y) are equivalent to y&x24. Right-to-left quotient and remainder x.__rdivmod__ (y) are equivalent to Divmod (y,x) 25. Right-to-left floor except x.__rfloordiv__ (y) is equivalent to y//x26. Right-and left-left shift x.__rlshift__ (y) is equivalent to x>>y27. Right-to-left modulo x.__rmod__ (y) is equivalent to y%x28. Right-to-left multiplication x.__mul__ (y) is equivalent to y*x29. Right-to-left or operation X.__ror__ (y) is equivalent to y|x30. Right-to-left power x.__rpow__ (y) is equivalent to y**x31. Right shift x.__rshift__ (Y) is equivalent to x>>y32. Right-to-left shift x.__rrshift__ (y) is equivalent to y>>x33. Right-to-left subtraction x.__rsub__ (y) is equivalent to y-x34. Right-to-left division x.__rtruediv__ (y) is equivalent to y/x35. Right-to-left XOR or Operation X.__rxor__ (y) is equivalent to y^x36. Returns the size of the object in memory, in bytes x.__sizeof__ () 37. Converting to String x.__str__ () is equivalent to STR (x) 38. Subtraction x.__sub__ (y) is equivalent to x-y39. Division x.__truediv__ () is equivalent to x/y40. The XOR operation X.__xor__ (y) is equivalent to x^y41. byte length, converted to binary after calculation, length in bytes x.bit_length ()

Introduction to the functions of int in Python

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.