Python3 List copy()方法

Python 3 教程 · 2019-02-06 14:42:45

描述

copy() 函数用于复制列表,类似于 a[:]

语法

copy()方法语法:

list.copy()

参数

  • 无。

返回值

返回复制后的新列表。

实例

以下实例展示了 copy()函数的使用方法:

#!/usr/bin/python3

list1 = ['Google', 'Codercto', 'Taobao', 'Baidu']
list2 = list1.copy()
print ("list2 列表: ", list2)

以上实例输出结果如下:

list2 列表:  ['Google', 'Codercto', 'Taobao', 'Baidu']

点击查看所有 Python 3 教程 文章: https://codercto.com/courses/l/10.html

查看所有标签

Numerical Methods and Methods of Approximation in Science and En

Numerical Methods and Methods of Approximation in Science and En

Karan Surana / CRC Press / 2018-10-31

ABOUT THIS BOOK Numerical Methods and Methods of Approximation in Science and Engineering prepares students and other readers for advanced studies involving applied numerical and computational anal......一起来看看 《Numerical Methods and Methods of Approximation in Science and En》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

SHA 加密
SHA 加密

SHA 加密工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具