内置函数

内置函数:拿过来就能用的

一共有68个内置函数

红的必须会,黄的了解,白的看看

1.作用域相关2个:

 locals

globals

2.str类型代码的执行3个

eval

exec

complie

3.其他10

  a.输入输出2个

 input

  print

b.数据类型相关1个

type

c.内存相关1

open

d.模块相关1个

_import_----------import

e.帮助1个

help

    进入help模式help()

     退出输入q

  制定查看某对象的帮助信息 help(o)

4.基础数据类型相关38

 a.和数字相关14个

     数据类型4个

     bool

     int

     float

     complex

进制转换3个

bin  二进制

oct  八进制

hex  十六进制

数学运算7个

abs 计算绝对值

divmod 返回(除、余)

min 计算最小值

 max 计算最大值,可以是序列,也可以是散列

 sum 求和,参数必须是一个序列类型

sound 小数精确

pow 幂运算

b.和数据结构相关24

        序列13个

            列表和元组2个

                        list

                         tuple

                相关内置函数2个

                         reversed  顺序的反转 

                         slice

         字符串9个

                   str

                  format

                  bytes    bytes(s,encoding='utf-8')

                 bytearray   bytearray(s,encoding='utf-8')

                  memoryview

                   ord  字符串按照unicode转数字

                    chr   数字按照unicode转字符

                    ascill  字符串转ascill

                    repr  用于%r格式化输出

             数据集合3个

                     字典1个

                         dict

                      集合2个

                         setsorted

原文地址:https://www.cnblogs.com/1996-11-01-614lb/p/7269285.html