Python中文网

Python3 内置函数有哪些?

cnpython423

 

Python3 内置函数包括:

  1. 数学函数:abs(), divmod(), pow(), round(), max(), min(), sum()

  2. 序列函数:len(), sorted(), reversed(), enumerate(), zip(), all(), any()

  3. 字符串函数:str(), chr(), ord(), format(), join(), split(), replace(), capitalize(), lower(), upper(), strip()

  4. 字典函数:dict(), keys(), values(), items(), get(), setdefault(), update(), pop()

  5. 文件函数:open(), close(), read(), write(), seek(), tell(), flush()

  6. 类型转换函数:int(), float(), bool(), str(), list(), tuple(), set(), dict(), frozenset()

  7. 其他函数:print(), input(), range(), id(), hash(), isinstance(), type(), help(), dir(), vars(), locals(), globals()

注意:上述列举的仅为部分常用的 Python3 内置函数,实际上 Python3 内置函数非常多,可以通过 Python3 官方文档查询到完整列表。

上一篇:没有了

下一篇:python3 内置函数 all()方法