There's a function in purple, there's a string in green, and in black I have the assignment statements.
还有个粉色的方法,绿色的字符串,赋值声明是黑色的。
s1 We're assigning to s1 the string that the user typed in.
我们把用户输入的字符串赋值给。
We've got values, numbers and strings.
我们讲到了值,数字和字符串。
All right? And if you want to do other things, whoops, sorry-- and add them together, we will get out, again, a concatenation of that string. And these will, we'll let you work through the variations, but these are the simple expressions we can use.
对不对?如果你想要进行一些别的操作,哦,对不起-是加到一块,然后结果值也是,两个字符串的链接,这些会,我们会让大家慢慢学习变量,但是这些是我们能用的最简单的表达式。
But that little short hand there is doing exactly the same thing. It is adding that value into some digits and putting it back or signing it back into some digits. And I'll walk through that loop and when I'm done I can print out the total thing does. And if I do that, I get out what I would expect.
加上得到的这个数的,但是这个缩写声明其实是进行了同样的操作,它把我们得到的这个数加到一个数上面去,然后用和对这个数进行了重新赋值,在循环中会去遍历字符串,当完成循环后,程序会显示数字的总和,如果我运行,这个程序的话,我会得到我期待的结果。
And it treats it as a string, it's simply getting me back 52*7 the value of that string, 52 times 7, rather than the value of it.
这让Python把它当做字符串来对待,他返回给我了,一个字符串的值,而不是这个数的和。
This was the special value that said to the computer string stops here and because you have that barrier given to you at the end of every string, just the most efficient way you can pass strings around is just by passing the address of their very first bytes, the location in RAM.
这是一个特殊的值,表示的是,字符串在这里结束,因为在每个字符串的末尾,都有那个关卡,这是一个最有效率的方式,你可以通过传递,字符串的第一个字节的地址来传递一个字符串,地址是在RAM中的。
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之前作为字符串出现,如果是真的话我就要做,一系列的操作,因为他们是在同一个块等级上。
I would like you to look at this piece of code right here called isPalindrome.
我将会输入一个字符串,命名为s,并局部赋值。
应用推荐