`
Shelly.Kuang
  • 浏览: 158227 次
  • 性别: Icon_minigender_2
  • 来自: 广州
社区版块
存档分类
最新评论

Python内置函数

 
阅读更多

 

The Python interpreter has a number of functions built into it that are always available. They are listed here in alphabetical order.


abs() divmod() input() open() staticmethod()
all() enumerate() int() ord() str()
any() eval() isinstance() pow() sum()
basestring() execfile() issubclass() print() super()
bin() file() iter() property() tuple()
bool() filter() len() range() type()
bytearray() float() list() raw_input() unichr()
callable() format() locals() reduce() unicode()
chr() frozenset() long() reload() vars()
classmethod() getattr() map() repr() xrange()
cmp() globals() max() reversed() zip()
compile() hasattr() memoryview() round() __import__()
complex() hash() min() set() apply()
delattr() help() next() setattr() buffer()
dict() hex() object() slice() coerce()
dir() id() oct() sorted() intern()
abs(x)

返回一个数的绝对值. The argument may be a plain or long integer or a floating point number. If the argument is a complex number, its magnitude is returned.

 

all(iterable)

Return True if all elements of the iterable are true (or if the iterable is empty). Equivalent to:

def all(iterable):
    for element in iterable:
        if not element:
            return False
    return True

New in version 2.5.

分享到:
评论

相关推荐

    python内置函数.pdf

    内置类型转换函数 3. 序列处理函数 4. String 模块 Chapter 1. 常用函数 abs(x) abs()返回一个数字的绝对值。如果给出复数,返回值就是该复数的模。 >>>print abs(-100) 100 >>>print abs(1+2j) 2.2360679775 ...

    python内置函数大全

    最近一直在看python 的document ,打算在基础方面重点看一下。罗列一下了基础的内置函数,分类可能不准确,一起交流学习

    python内置函数集合

    python内置函数集合,基本的python的内置函数都有,仅供新手参考,查阅

    python内置函数

    该文档对Python常用的内置函数进行了归纳总结,包括数学类、集合类、逻辑判断、io操作等,并以表格形式给出,对函数进行了详细讲解。

    python 内置函数汇总详解

    主要介绍了python 内置函数汇总详解,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下

    Python内置函数汇总

    Talk is cheap, show me the code.  if __name__ == '__main__': """abs() 取绝对值""" assert abs(-1) == 1 """all(iterator) 迭代对象中 全部为True 才返回True""" assert all([0, '', None, False]) is ...

    Python内置函数dir详解

    主要介绍了Python内置函数dir详解,本文讲解了命令介绍、使用实例、使用dir查找module下的所有类、如何找到当前模块下的类等内容,需要的朋友可以参考下

    python 内置函数filter

    python 内置函数filter class filter(object): filter(function or None, iterable) --> filter object Return an iterator yielding those items of iterable for which function(item) is true. If ...

Global site tag (gtag.js) - Google Analytics