#create a tuple
tuplex = (, , , , , , , , , )
#used tuple[start:stop] the start index is inclusive and the stop index
_slice = tuplex[:]
#is exclusive
print(_slice)
#if the start index isn't defined, is taken from the beg inning of the tuple
_slice = tuplex[:]
print(_slice)
#if the end index isn't defined, is taken until the end of the tuple
_slice = tuplex[:]
print(_slice)
#if neither is defined, returns the full tuple
_slice = tuplex[:]
print(_slice)
#The indexes can be defined with negative values
_slice = tuplex[-:-]
print(_slice)
#create another tuple
tuplex = tuple("HELLO WORLD")
print(tuplex)
#step specify an increment between the elements to cut of the tuple
#tuple[start:stop:step]
_slice = tuplex[::]
print(_slice)
#returns a tuple with a jump every items
_slice = tuplex[::]
print(_slice)
#when step is negative the jump is made back
_slice = tuplex[::-]
print(_slice)

最新文章

  1. POJ1704 Georgia and Bob
  2. React + Redux 入坑指南
  3. TortoiseSVN文件夹及文件图标不显示解决方法
  4. 努力学习 HTML5 (4)—— 浏览器对语义元素的支持情况
  5. sql 表连接 join
  6. cvc-elt.1: 找不到元素 'beans' 的声明
  7. js中关于arguments
  8. STM32 使用 printf 发送数据配置方法 -- 串口 UART, JTAG SWO, JLINK RTT
  9. error while loading shared libraries: libgtk-x11-2.0.so.0 2014-05-12 22:49:34
  10. load dll
  11. dbutils的使用Demo
  12. python-认识Socket[入门篇]
  13. hdu--1072--Nightmare(bfs回溯)
  14. Java中RuntimeException和Exception的区别
  15. python导出zabbix数据并发邮件脚本
  16. 性能测试工具 wrk 使用教程
  17. JMeter学习笔记01-安装环境
  18. MySQL 中的数字类型
  19. RxSwift之路 2#如何开始
  20. 关于Handler中Message的创建问题

热门文章

  1. [LeetCode] 101. Symmetric Tree_ Easy tag: BFS
  2. 使用masory
  3. Winsock网络编程
  4. VMware Coding Challenge: Possible Scores && Summary: static
  5. 兼容安卓和ios实现一键复制内容到剪切板
  6. nginx的权限问题(Permission denied)解决办法
  7. python3.4学习笔记(二十四) Python pycharm window安装redis MySQL-python相关方法
  8. mysql修改Truncated incorrect DOUBLE value:
  9. MySQL性能分析和优化
  10. [转] Python的import初探