python __builtins__ int类 (36)
36、'int', 用于将一个字符串或数字转换为整型
class int(object)
| int(x=0) -> integer
| int(x, base=10) -> integer
|
| Convert a number or string to an integer, or return 0 if no arguments
| are given. If x is a number, return x.__int__(). For floating point
| numbers, this truncates towards zero.
|
| If x is not a number or if base is given, then x must be a string,
| bytes, or bytearray instance representing an integer literal in the
| given base. The literal can be preceded by '+' or '-' and be surrounded
| by whitespace. The base defaults to 10. Valid bases are 0 and 2-36.
| Base 0 means to interpret the base from the string as an integer literal.
| >>> int('0b100', base=0)
| 4
|
| Methods defined here:
|
| __abs__(self, /)
| abs(self)
|
| __add__(self, value, /)
| Return self+value.
|
| __and__(self, value, /)
| Return self&value.
|
| __bool__(self, /)
| self != 0
|
| __ceil__(...)
| Ceiling of an Integral returns itself.
|
| __divmod__(self, value, /)
| Return divmod(self, value).
|
| __eq__(self, value, /)
| Return self==value.
|
| __float__(self, /)
| float(self)
|
| __floor__(...)
| Flooring an Integral returns itself.
|
| __floordiv__(self, value, /)
| Return self//value.
|
| __format__(...)
| default object formatter
|
| __ge__(self, value, /)
| Return self>=value.
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __getnewargs__(...)
|
| __gt__(self, value, /)
| Return self>value.
|
| __hash__(self, /)
| Return hash(self).
|
| __index__(self, /)
| Return self converted to an integer, if self is suitable for use as an index into a list.
|
| __int__(self, /)
| int(self)
|
| __invert__(self, /)
| ~self
|
| __le__(self, value, /)
| Return self<=value.
|
| __lshift__(self, value, /)
| Return self<<value.
|
| __lt__(self, value, /)
| Return self<value.
|
| __mod__(self, value, /)
| Return self%value.
|
| __mul__(self, value, /)
| Return self*value.
|
| __ne__(self, value, /)
| Return self!=value.
|
| __neg__(self, /)
| -self
|
| __new__(*args, **kwargs) from builtins.type
| Create and return a new object. See help(type) for accurate signature.
|
| __or__(self, value, /)
| Return self|value.
|
| __pos__(self, /)
| +self
|
| __pow__(self, value, mod=None, /)
| Return pow(self, value, mod).
|
| __radd__(self, value, /)
| Return value+self.
|
| __rand__(self, value, /)
| Return value&self.
|
| __rdivmod__(self, value, /)
| Return divmod(value, self).
|
| __repr__(self, /)
| Return repr(self).
|
| __rfloordiv__(self, value, /)
| Return value//self.
|
| __rlshift__(self, value, /)
| Return value<<self.
|
| __rmod__(self, value, /)
| Return value%self.
|
| __rmul__(self, value, /)
| Return value*self.
|
| __ror__(self, value, /)
| Return value|self.
|
| __round__(...)
| Rounding an Integral returns itself.
| Rounding with an ndigits argument also returns an integer.
|
| __rpow__(self, value, mod=None, /)
| Return pow(value, self, mod).
|
| __rrshift__(self, value, /)
| Return value>>self.
|
| __rshift__(self, value, /)
| Return self>>value.
|
| __rsub__(self, value, /)
| Return value-self.
|
| __rtruediv__(self, value, /)
| Return value/self.
|
| __rxor__(self, value, /)
| Return value^self.
|
| __sizeof__(...)
| Returns size in memory, in bytes
|
| __str__(self, /)
| Return str(self).
|
| __sub__(self, value, /)
| Return self-value.
|
| __truediv__(self, value, /)
| Return self/value.
|
| __trunc__(...)
| Truncating an Integral returns itself.
|
| __xor__(self, value, /)
| Return self^value.
|
| bit_length(...)
| int.bit_length() -> int
|
| Number of bits necessary to represent self in binary.
| >>> bin(37)
| '0b100101'
| >>> (37).bit_length()
| 6
|
| conjugate(...)
| Returns self, the complex conjugate of any int.
|
| from_bytes(...) from builtins.type
| int.from_bytes(bytes, byteorder, *, signed=False) -> int
|
| Return the integer represented by the given array of bytes.
|
| The bytes argument must be a bytes-like object (e.g. bytes or bytearray).
|
| The byteorder argument determines the byte order used to represent the
| integer. If byteorder is 'big', the most significant byte is at the
| beginning of the byte array. If byteorder is 'little', the most
| significant byte is at the end of the byte array. To request the native
| byte order of the host system, use `sys.byteorder' as the byte order value.
|
| The signed keyword-only argument indicates whether two's complement is
| used to represent the integer.
|
| to_bytes(...)
| int.to_bytes(length, byteorder, *, signed=False) -> bytes
|
| Return an array of bytes representing an integer.
|
| The integer is represented using length bytes. An OverflowError is
| raised if the integer is not representable with the given number of
| bytes.
|
| The byteorder argument determines the byte order used to represent the
| integer. If byteorder is 'big', the most significant byte is at the
| beginning of the byte array. If byteorder is 'little', the most
| significant byte is at the end of the byte array. To request the native
| byte order of the host system, use `sys.byteorder' as the byte order value.
|
| The signed keyword-only argument determines whether two's complement is
| used to represent the integer. If signed is False and a negative integer
| is given, an OverflowError is raised.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| denominator
| the denominator of a rational number in lowest terms
|
| imag
| the imaginary part of a complex number
|
| numerator
| the numerator of a rational number in lowest terms
|
| real
| the real part of a complex number
python __builtins__ int类 (36)的更多相关文章
- python __builtins__ bool类 (6)
6.'bool', 函数用于将给定参数转换为布尔类型,如果没有参数,返回 False. class bool(int) # 继承于int类型 | bool(x) -> bool # 创建boo ...
- python __builtins__ float类 (25)
25.'float', 用于将整数和字符串转换成浮点数. class float(object) | float(x) -> floating point number | | Convert ...
- python __builtins__ type类 (69)
69.'type', 返回对象类型 class type(object) | type(object_or_name, bases, dict) | type(object) -> the ob ...
- python __builtins__ str类 (65)
65.'str', 字节转换成字符串.第一个传入参数是要转换的字节,第二个参数是按什么编码转换成字符串 class str(object) | str(object='') -> str | s ...
- python __builtins__ staticmethod类 (64)
64.'staticmethod', 返回静态方法 class staticmethod(object) | staticmethod(function) -> method | | Conve ...
- python __builtins__ memoryview类 (46)
46.'memoryview', 返回给定参数的内存查看对象(Momory view).所谓内存查看对象,是指对支持缓冲区协议的数据进行包装,在不需要复制对象基础上允许Python代码访问. cla ...
- python __builtins__ help类 (32)
32.'help', 接收对象作为参数,更详细地返回该对象的所有属性和方法 class _Helper(builtins.object) | Define the builtin 'help'. | ...
- python __builtins__ complex类 (13)
13.'complex', 函数用于创建一个值为 real + imag * j 的复数或者转化一个字符串或数为复数.如果第一个参数为字符串,则不需要指定第二个参数. class complex(ob ...
- python __builtins__ classmethod类 (11)
11.'classmethod', 修饰符对应的函数不需要实例化,不需要 self 参数,但第一个参数需要是表示自身类的 cls 参数,可以来调用类的属性,类的方法,实例化对象等. class cla ...
随机推荐
- centos7 网络不能重启问题 解决办法
cnetos7 网络不可重启 突然解决办法 参考他人处理 之前部署hadoop环境,在自己机器上安装了一台centos虚拟机,然后图省事,就克隆出三台,一台为master,另两台来作为 slave. ...
- 【剑指offer】异或去重
转载请注明出处:http://blog.csdn.net/ns_code/article/details/27568975 这篇文章没有代码.介绍的是纯理论的思路. 异或是一种基于二进制的位运算,用符 ...
- Oracle db中禁止使用sqlplus的方法
先记录下来: How to Disable a SQL*Plus Connection for a User (文档 ID 124121.1)
- 【转载】VS工具使用——代码生成函数关系图
小引: 在上篇文章<VS工具使用--代码图>中,我向大家介绍了我对工具"代码图"的发现和认识.真是感觉当自己的眼睛不再被蒙蔽的时候,会发现整个世界的美好. ...
- POJ 1151 HDU 1542 Atlantis(扫描线)
题目大意就是:去一个地方探险,然后给你一些地图描写叙述这个地方,每一个描写叙述是一个矩形的右下角和左上角.地图有些地方是重叠的.所以让你求出被描写叙述的地方的总面积. 扫描线的第一道题,想了又想,啸爷 ...
- HBuilder开发App教程06-首页
实战 前面几节基本是一些概念的普及, 正如前面提到的,本教程会以滴石作为范例进行解说, 有兴趣的能够先行下载体验一下.或者下载源代码研究下. 新建项目 打开HBuilder,在项目管理器中右键--新建 ...
- 诊断并解决 ORA-4030 错误 (Doc ID 1548826.1)
适用于: Oracle Database - Enterprise Edition - 版本号 8.1.7.4 和更高版本号 本文档所含信息适用于全部平台 用途 怎样诊断 ORA-4030 错误 排错 ...
- JavaScript 的 MVP 框架 Riot.js
Riot.js 详细介绍 Riot.js是一个客户端模型-视图-呈现(MVP)框架并且它非常轻量级甚至小于1kb.尽管他的大小令人难以置信,所有它能构建的有如下:一个模板引擎,路由,甚至是库和一个严格 ...
- lonlifeOJ1152 “玲珑杯”ACM比赛 Round #19 概率DP
E -- Expected value of the expression DESCRIPTION You are given an expression: A0O1A1O2A2⋯OnAnA0O1A1 ...
- Spring中的AOP(学习笔记)
是什么AOP及实现方式 AOP的基本概念 Schema-base AOP Spring AOP API AspectJ