常用Python的BIF指令
来源:互联网 发布:淘宝快递盒上会有 编辑:程序博客网 时间:2024/05/22 16:48
>>> # 常用BIF
>>> # 内置函数多为紫色,字符串为绿色,关键字为橙色
>>> print('hello world')
hello world
>>> cast=['a','b','c','d']
>>> # append()在列表末尾增加一个数据项,pop()从列表末尾删除数据项,extend()可在列表末尾添加多个数据项,remove()移除列表中的指定项,insert()在指定的数据前增加一个数据项
>>> cast.append('e')
>>> print(cast)
['a', 'b', 'c', 'd', 'e']
>>> cast.pop()
'e'
>>> print(cast)
>>> # 内置函数多为紫色,字符串为绿色,关键字为橙色
>>> print('hello world')
hello world
>>> cast=['a','b','c','d']
>>> # append()在列表末尾增加一个数据项,pop()从列表末尾删除数据项,extend()可在列表末尾添加多个数据项,remove()移除列表中的指定项,insert()在指定的数据前增加一个数据项
>>> cast.append('e')
>>> print(cast)
['a', 'b', 'c', 'd', 'e']
>>> cast.pop()
'e'
>>> print(cast)
['a', 'b', 'c', 'd']
>>> cast.extend(['a','b'])
>>> print(cast)
['a', 'b', 'c', 'd', 'a', 'b']
>>> cast.remove('d')
>>> print(cast)
['a', 'b', 'c', 'a', 'b']
>>> cast.insert(0,'w')
>>> print(cast)
['w', 'a', 'b', 'c', 'a', 'b']
>>> for a in range(1,5):
print(a,end='')
1234
#其中a为目标标识符,每次运行时目标标识符会指示一个不同的数值
>>> number=[3,4,5]
>>> isinstance(number,list)
True
>>> isinstance(number[1],list)
False
>>> isinstance(number[1],int)
True
#使用find可以查找字符串中的子串,如果没有则返还-1,如果有则返回 该子串的位置
>>> each_line='i tell you that the man is not bad'
>>> each_line.find(':')
-1
>>> each_line='i tell you: that the man is not bad'
>>> each_line.find(':')
10
0 0
- 常用Python的BIF指令
- python【1】Python中常用的快捷键和BIF
- PYTHON-BIF相关
- BIF:python内置函数
- python关于BIF、标准库方法使用的注意事项总结
- python--两个牛逼的BIF,内置函数
- 【python】类和对象:一些相关的BIF
- python的BIF和保留字(三)
- 对象相关的BIF
- Python常用指令
- python常用指令
- python常用指令
- python的内建函数(BIF)range(start, stop, step)
- erlang常用内建函数BIF
- Python3 常用BIF( Built-in Functions)简介
- python中的内建函数(BIF)
- python BIF /操作符 / If else / assert
- Python闭包函数和一些BIF
- C++模板实现Stack
- 第十四周项目二(2)-两个成员的类模板
- lucence入门
- Android SnackBar学习
- spring framework官方下载地址
- 常用Python的BIF指令
- DHTML:<input type="file">
- Greenplum或DeepGreen中使用外部表访问Hive数据(分隔符是Hive表默认列分隔符)
- 互联网公司KPI
- http post request header is too large 问题
- js 实现dom的控制
- MAC系统上设置华为手机的调试模式
- JavaScript---网络编程(10)--DHTML技术演示(3)-多选框
- ios 学习之 NSPredicate 模糊、精确、查询