Access by Offset
来源:互联网 发布:新版淘宝不能指纹支付 编辑:程序博客网 时间:2024/06/16 00:36
Great work! (By the way, you could also have repaired the string by replacing the single quotes on the ends with double quotes, like this: "Help! Help! I'm being repressed!"
.)
Remember how we told you that strings were, technically speaking, strings of characters? Wouldn't it be nifty if you could get to each character in a string individually?
Well, you can!
Each character in a string has a subscriptor offset, which is a fancy way of saying it has a number attached to it. The number starts at 0 for the leftmost character and increases by one as you move character-by-character to the right. Check out the diagram in the editor!
"""The string "PYTHON" has six characters,numbered 0 to 5, as shown below:+---+---+---+---+---+---+| P | Y | T | H | O | N |+---+---+---+---+---+---+ 0 1 2 3 4 5So if you wanted "Y", you could just type"PYTHON"[1] (always start counting from 0!)"""fifth_letter ="MONTY" fifth_letter=fifth_letter[4]print fifth_letter
When you think you've got the hang of the code in the editor, setfifth_letter
equal to the fifth letter of the string "MONTY"
, like so:"MONTY"[?]
(but replace the ?
with the correct number).
- Access by Offset
- offset
- offset
- offset
- √ ORDER BY x OFFSET 10000 LIMIT 4;
- Excel To Access by asp
- table access by index rowid
- OpenCV access elements by pointer
- OpenCV access elements by iterator
- table access by index rowid
- ORA-24247: network access denied by access control list
- ASP ACCESS 数据高级搜索 By Stabx
- ASP ACCESS 数据高级搜索 By Stabx
- Microsoft Office Access 2003 Step by Step
- Microsoft Office Access 2007 Step by Step
- Advanced Orders Access by customer group
- Oracle TABLE ACCESS BY INDEX ROWID 说明
- From mac to access Winxp by virtualbox
- jrebel 使用
- Mysql SQL Mode简介
- Java 学习笔记——字符串
- sudoers文件解析
- java MD5加密类
- Access by Offset
- Maven和Tycho
- 让序列化与Socket合作愉快
- javaWeb得到上传的文件
- Vbox虚拟机 所选虚拟电脑不能正常访问
- Beyond Compare 关于回车换行的问题
- 使用Preferencescreen启动Activity
- WinCE Display驱动开发介绍
- css3 transition split(分裂旋转效果)