Python 内置函数

2024-10-19 21:04:56

1、divmod(10,3): 把10除以3取商和余数

Python 内置函数

2、enumerate: for循环列表只打印值,enumerater可以打印索引和值

Python 内置函数

3、isinstance: 查看数据类型

Python 内置函数

4、range(0,6)正向取值range猾诮沓靥(0,-6)取负值range(0,6,2)步长2 #0,2,4range(5,0,-1)倒数

Python 内置函数

5、reversed :反转数据后返回迭代器

Python 内置函数

6、slice: 步长

Python 内置函数
猜你喜欢