小白教程
所有教程
关于
Search
172.70.100.162
172.70.100.162
参数设置
贡献
退出
操作
编辑
移动
保护
信息
历史
删除
查看“Python3 att list copy”的源代码
本页内容
上一节:
Python3_att_list_clear
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{DISPLAYTITLE:list.copy()}}[[Category:python3 list|15]] = Python3 List copy()方法 = [[python3 list|Python3 列表]] == 描述 == copy() 函数用于复制列表,类似于 '''a[:]'''。 == 语法 == copy()方法语法: <sample title="" desc="" lang="python" hererun="1"> list.copy() </sample> == 参数 == * 无。 == 返回值 == 返回复制后的新列表。 以下实例展示了 copy()函数的使用方法: <sample title="" desc="" lang="python" hererun="1"> #!/usr/bin/python3 list1 = ['Google', 'xiaoBai', 'Taobao', 'Baidu'] list2 = list1.copy() print ("list2 列表: ", list2) </sample> 以上实例输出结果如下: <sample title="" desc="" lang="python" hererun="1"> list2 列表: ['Google', 'xiaoBai', 'Taobao', 'Baidu'] </sample> [[python3 list|Python3 列表]]
返回至“
Python3 att list copy
”。
上一节:
Python3_att_list_clear