微科社区,轻松开发从此开始! 请登陆 免费注册

微科社区

当前位置:首页 > 编程语言 > Delphi >

Python开发【第三篇】:Python基本数据类型

时间:2016-10-04 21:22  浏览:努力统计中...
运算符 1、算数运算: 2、比较运算: 3、赋值运算: 4、逻辑运算: 5、成员运算: 基本数据类型 1、数字 int(整型) 在32位机器上,整数的位数为32位,取值范围为-2**31~2**31-1,即-

运算符

1、算数运算:

2、比较运算:

3、赋值运算:

4、逻辑运算:

5、成员运算:

基本数据类型

1、数字

int(整型)

  在32位机器上,整数的位数为32位,取值范围为-2**31~2**31-1,即-2147483648~2147483647
  在64位系统上,整数的位数为64位,取值范围为-2**63~2**63-1,即-9223372036854775808~9223372036854775807
class int(object):    """    int(x=0) -> int or long    int(x, base=10) -> int or long        Convert a number or string to an integer, or return 0 if no arguments    are given.  If x is floating point, the conversion truncates towards zero.    If x is outside the integer range, the function returns a long instead.        If x is not a number or if base is given, then x must be a string or    Unicode object 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    """    def bit_length(self):         """ 返回表示该数字的时占用的最少位数 """        """        int.bit_length() -> int                Number of bits necessary to represent self in binary.        >>> bin(37)        '0b100101'        >>> (37).bit_length()        6        """        return 0    def conjugate(self, *args, **kwargs): # real signature unknown        """ 返回该复数的共轭复数 """        """ Returns self, the complex conjugate of any int. """        pass    def __abs__(self):        """ 返回绝对值 """        """ x.__abs__() <==> abs(x) """        pass    def __add__(self, y):        """ x.__add__(y) <==> x+y """        pass    def __and__(self, y):        """ x.__and__(y) <==> x&y """        pass    def __cmp__(self, y):         """ 比较两个数大小 """        """ x.__cmp__(y) <==> cmp(x,y) """        pass    def __coerce__(self, y):        """ 强制生成一个元组 """         """ x.__coerce__(y) <==> coerce(x, y) """        
TAG:
顶一下
(0)
0%
踩一下
(0)
0%
------分隔线------
栏目列表
推荐内容