And the nice thing is that there's a shared behavior there. Just as I can have tuples as an ordered collection of things, strings behave as an ordered collection of things.
共享的行为,就像元组是有序的元素序列,字符串也是有序的元素序列,因此我可以对字符串做同样的操作,我可以把它们连结起来。
If somewhere later on in the code it shifts to string, I might not be manipulating that and getting actual values out, but not what I wanted, and it's going to be really hard for me to chase it back.
然后后面的一些代码,把变量类型变为了字符串,我可能不会通过实际操作,去取得实际的变量的类型,但是这并不是我想要的类型,而且对我来说把类型,变回去也很困难。
You don't see strings with commas between them, but it has the same kind of property. It is in ordered sequence of characters.
它是有序的字符序列,我们可以对字符串做同样的操作,我们也可以得到字符串中的一块。
We have some set of things we want to do with strings, and different set of things we want to do with numbers.
这就对了,我们有一个可以对字符串,进行操作的方法集,还有另外一个不同的。
As we saw before, it simply concatenates them together and gives me back a longer string.
和我们之前学过的一样,这个操作会把两个字符串连接起来。
In a particular, I have similar operations on strings.
尤其是我可以对字符串使用类似的操作。
I'm doing a test there to say, x if the string x is less than the value of b, and x does not appear before b as strings, then I was going to do, oh, a couple of things, because they're at the same block level.
我正在做一个测试来看看,字符串,是不是小于b的值,而且x不在b之前作为字符串出现,如果是真的话我就要做,一系列的操作,因为他们是在同一个块等级上。
应用推荐