- 从零开始学Python大数据与量化交易
- 周峰 王可群
- 181字
- 2021-03-30 19:09:44
4.1.6 列表的方法
前面已讲解列表的append()方法,下面讲解其他列表方法。列表的方法名称及功能说明如表4.2所示。
表4.2 列表的方法名称及功能说明

列表的方法示例如下。
单击“开始”菜单,打开Python 3.6.5 Shell软件,然后在菜单栏中选择File→New File命令,创建一个Python文件,并命名为Python4-5.py,然后输入以下代码:

在菜单栏中选择Run→Run Module命令或按键盘上的F5键,就可以运行程序代码,结果如图4.5所示。

图4.5 列表的方法示例的运行结果