首页 > 编程语言 > 详细

python 内置函数和匿名函数

时间:2018-12-30 02:27:55      阅读:250      评论:0      收藏:0      [点我收藏+]

内置函数

  截止到python版本3.6.2,现在python一共为我们提供了68个内置函数。

 

  Built-in Functions  
abs() dict() help() min() setattr()
all() dir() hex() next() slice()
any() divmod() id() object() sorted()
ascii() enumerate() input() oct() staticmethod()
bin() eval() int() open() str()
bool() 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()  
delattr() hash() memoryview() set()  

 

技术分享图片

一、作用域相关

技术分享图片

基于字典的形式获取局部变量和全局变量

globals()——获取全局变量的字典

locals()——获取执行本方法所在命名空间内的局部变量的字典

 

python 内置函数和匿名函数

原文:https://www.cnblogs.com/dongye95/p/10198106.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!