python第20篇之--元组的使用
来源:互联网 发布:疯狂的美工京东注册码 编辑:程序博客网 时间:2024/05/14 08:03
#!/usr/bin/pythonzoo = ('python','elephant','penguin')print('Number of animals in the zoo os',len(zoo))new_zoo = ('monkey','camel',zoo)print('Number of the cages in the new zoo is',len(new_zoo))print('All animals in new zoo are',new_zoo)print('Animals brought from old zoo are:',new_zoo[2])print('Last anials brought from old zoo is',new_zoo[2][2])print('Number of animals in the new zoo is',len(new_zoo)-1+len(new_zoo[2]))
结果:
~/Note/python # ./2using_tutle.py Number of animals in the zoo os 3Number of the cages in the new zoo is 3All animals in new zoo are ('monkey', 'camel', ('python', 'elephant', 'penguin'))Animals brought from old zoo are: ('python', 'elephant', 'penguin')Last anials brought from old zoo is penguinNumber of animals in the new zoo is 5
阅读全文
0 0
- python第20篇之--元组的使用
- Python基础之列表、元组、字典、集合的使用
- python容器之元组、集合使用
- Python基础教程之第2章 列表和元组
- 《Python基础教程第2版》之列表和元组
- python之元组
- python之元组
- python之元组
- Python 使用元组
- python学习8:元组的使用
- Python列表和元组的使用
- python中的列表、元组的使用
- python第19篇之-列表的使用
- Python 之 元组小结
- Python 之 元组小结
- python之元组操作
- Python 之 元组小结
- Python数据类型之元组
- design patterns
- 史上最全最强SpringMVC详细分享
- centos7安装mysql
- android中的BuildConfig
- 491. Increasing Subsequences
- python第20篇之--元组的使用
- 解决 Android N 7.0 上 报错:android.os.FileUriExposedException
- 求一组整数的第二大数
- 分布式
- 使用 keepalived 设置虚拟 IP 环境
- 对House Robber问题的探究
- 动作事件的监听演示代码
- 错题整理1
- javascript之DOM操作