例9.5 使用序列
来源:互联网 发布:淘宝店装修视频教程 编辑:程序博客网 时间:2024/05/09 02:23
源文件:code/reference.py
#!/usr/bin/python# Filename: reference.pyprint 'Simple Assignment'shoplist = ['apple', 'mango', 'carrot', 'banana']mylist = shoplist # mylist is just another name pointing to the same object!del shoplist[0]print 'shoplist is', shoplistprint 'mylist is', mylist# notice that both shoplist and mylist both print the same list without# the 'apple' confirming that they point to the same objectprint 'Copy by making a full slice'mylist = shoplist[:] # make a copy by doing a full slicedel mylist[0] # remove first itemprint 'shoplist is', shoplistprint 'mylist is', mylist# notice that now the two lists are different
输出$ python reference.pySimple Assignmentshoplist is ['mango', 'carrot', 'banana']mylist is ['mango', 'carrot', 'banana']Copy by making a full sliceshoplist is ['mango', 'carrot', 'banana']mylist is ['carrot', 'banana']
0 0
- 例9.5 使用序列
- 序列使用
- oracle序列的使用
- oracle 序列的使用
- db2序列使用
- oracle中使用序列
- oracle 序列的使用
- oralce 序列的使用
- jdbc中使用序列
- 关于序列使用详解
- Hibernate+Oracle使用序列
- 使用 System.IO 序列
- 创建使用序列
- C++序列化使用
- postgreSQL中的序列使用
- MySQL中的序列使用
- PostgreSQL 序列使用
- 序列的使用
- Makefile origin 函数
- Python Tkinter 应用窗口
- zailai
- 黑马程序员——集合框架之Map
- Point-In-Time recovery
- 例9.5 使用序列
- 感言
- Linux ALSA声卡驱动之二:声卡的创建 .
- SCUT重组赛第一场_C_Circles_二分搜索、数状数组、尺取法
- hiho一下 第六周 Hihocoder #1038 : 01背包
- 注册一家互联网公司基本流程
- ZK(7.0.1)国际化的简单示例
- 文件上传组件SWFUpload 介绍
- 什么人不宜吃花生 八种人远离花生更健康