一、内置函数

内置函数是python自带的一系列常用函数。

二、python3中内置函数

    内置功能    
abs() delattr() hash() memoryview() set()
all() dict() help() min() setattr()
any() dir() hex() next() slice()
ascii() divmod() id() object() sorted()
bin() enumerate() input() oct() staticmethod()
bool() eval() int() open() str()
breakpoint() exec() isinstance() ord() sum()
bytearray() filter() issubclass() pow() super()
bytes() float() iter() print() tuple()
callable() format() len() property() type()
chr() frozenset() list() range() vars()
classmethod() getattr() locals() repr() zip()
compile() globals() map() reversed() __import__()
complex() hasattr() max() round()

三、内置方法

内置方法  说明
 __init__(self,...)  初始化对象,在创建新对象时调用
 __del__(self)  释放对象,在对象被删除之前调用
 __new__(cls,*args,**kwd)  实例的生成操作
 __str__(self)  在使用print语句时被调用
 __getitem__(self,key)  获取序列的索引key对应的值,等价于seq[key]
 __len__(self)  在调用内联函数len()时被调用
 __cmp__(stc,dst)  比较两个对象src和dst
 __getattr__(s,name)  获取属性的值
 __setattr__(s,name,value)  设置属性的值
 __delattr__(s,name)  删除name属性
 __getattribute__()  __getattribute__()功能与__getattr__()类似
 __gt__(self,other)  判断self对象是否大于other对象
 __lt__(slef,other)  判断self对象是否小于other对象
 __ge__(slef,other)  判断self对象是否大于或者等于other对象
 __le__(slef,other)  判断self对象是否小于或者等于other对象
 __eq__(slef,other)  判断self对象是否等于other对象
 __call__(self,*args)  把实例对象作为函数调用

转至 :https://www.cnblogs.com/hongfei/p/3858256.html

python 函数--内置函数的更多相关文章

  1. python基础-内置函数详解

    一.内置函数(python3.x) 内置参数详解官方文档: https://docs.python.org/3/library/functions.html?highlight=built#ascii ...

  2. 如何查看Python的内置函数

    经常调用的时候不知道python当前版本的内置函数是哪些,可以用下面的指令查看: C:\Users\Administrator>python Python 2.7.11 (v2.7.11:6d1 ...

  3. python_way,day3 集合、函数、三元运算、lambda、python的内置函数、字符转换、文件处理

    python_way,day3 一.集合 二.函数 三.三元运算 四.lambda 五.python的内置函数 六.字符转换 七.文件处理 一.集合: 1.集合的特性: 特性:无序,不重复的序列 如果 ...

  4. python基础——内置函数

    python基础--内置函数  一.内置函数(python3.x) 内置参数详解官方文档: https://docs.python.org/3/library/functions.html?highl ...

  5. python(day16)内置函数,匿名函数

    # add = lambda x,y:x+y # print(add(1,2)) # dic={'k1':10,'k2':100,'k3':30} # def func(key): # return ...

  6. Python第七天 函数 函数参数 函数里的变量 函数返回值 多类型传值 函数递归调用 匿名函数 内置函数

    Python第七天   函数  函数参数   函数里的变量   函数返回值  多类型传值     函数递归调用   匿名函数   内置函数 目录 Pycharm使用技巧(转载) Python第一天   ...

  7. Python的内置函数

    python的内置函数一共有68个,下面将简单介绍各个函数的功能. abs() dict() help() min() setattr() all() dir() hex() next() slice ...

  8. python 匿名函数&内置函数

    匿名函数:为了解决那些功能很简单的需求而设计的一句话函数怎么定义匿名函数: cal = lambda x : x*x # cal是函数名,lambda是定义匿名函数的关键字 冒号前面的额x是参数即函数 ...

  9. python print()内置函数

    啦啦啦啦啦啦,我又来了,学习任何东西都得坚持,我一定的好好加油!!! 今天来说说print()函数,前边我们已经用过好好多次啦,现在来学习哈吧!!! Python的内置函数,print() print ...

  10. Python学习笔记014——迭代工具函数 内置函数enumerate()

    1 描述 enumerate() 函数用于将一个可遍历的数据对象(如列表.元组或字符串)组合为一个索引序列,同时列出数据和数据下标,一般用在 for 循环当中. 2 语法 enumerate(sequ ...

随机推荐

  1. 关于WDK开发内核签名之WHQL签名认证流程简介

    WHQL简介: WHQL全称Windows Hardware Quality Labs testing(Windows硬件质量实验室测试)它是对所涉及的第三方硬件或软件进行一系列测试,然后提交测试的日 ...

  2. ExifPro Mod 3.0 64位绿色中文版

    EXIFPro 是一个优秀的图像查看, 处理及管理工具, 使用 VC++ 开发, 小巧快速, 支持查看丰富的 EXIF 信息, 非常适用于查看您的 RAW 数字照片和其他常规图像.EXIFPro V1 ...

  3. python的C扩展调用,使用原生的python-C-Api

    1.在文件第一行包含python调用扩展的头文件 #include <Python.h> 2.用原生C写好需要调用的函数 int add_one(int a){ ; } 3.用python ...

  4. Deepin中安装使用好用的字典GoldenDict

    2020-03-21   23:08:17 不说废话直接来安装步骤: 打开Deepin的应用商店,输入GoldenDict查找: 找到后点击安装,然后等待一小会,电脑提示音告诉你已经安装完成: 然后再 ...

  5. Python - 面向对象(二)类方法、静态方法

    面向对象的各种方法 静态方法 - @staticmethod class Person(): name = "cool guy" @staticmethod def static( ...

  6. idea安装 阿里巴巴Java编码准则插件

    首先还是打开熟悉的idea 在marketplace 输入 alibaba 我这是已经安装过了 下载完成之后重启idea生效 如果需要那就手动的扫描 当然已经自动的扫描了 如果你的代码不符合阿里的标准 ...

  7. Python3 整数

    imag定义:返回整数的复数形式的虚部(返回整数).格式:intobject.imag real定义:返回整数的复数形式的实部(返回整数).格式:intobject.real conjugate()定 ...

  8. python使用pip安装模块出现ReadTimeoutError: HTTPSConnectionPool的解决方法

    今天使用pip安装第三库时,有时会报错: pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='file ...

  9. Cookie SameSite属性介绍及其在ASP.NET项目中的应用

    一.Cookie SameSite属性介绍 就像大家已经知道的,一旦设置Cookie之后,在Cookie失效之前浏览器会一直将这个Cookie在后续所有的请求中都传回到Server端.我们的系统会利用 ...

  10. ImportError: libcusolver.so.8.0: cannot open shared object file: No such file or directory

    问题描述: ImportError: libcusolver.so.8.0: cannot open shared object file: No such file or directory 首先检 ...