It is going to give me back a tuple a collection of two things, and so check out the syntax.
它将给我返回一个数组或者系列的一对值,然后检查一下语法。
And then, they hand me that receipt and I sign for that receipt and then I give it back to them.
之后他们给我收据,然后我在上面签字,然后把收据交还他们。
So I can similarly do this, which is going to look strange because it's going to give me the same value back out, but it actually did a slightly different thing.
我也可以通过类似的手段来达到这个目的,这看起来很奇怪,但是会返回相同的值,但是它的实现真的有点不同。
Z So it would be incorrect to try to assign this to a variable X or Y or Z, because it doesn't actually give me anything back.
这个是错误的,来赋值这个给变量X或Y或,因为它的确没有返回什么给我。
Computing square root. I'm going to capture it in a piece of code, I'm going to be able to refer to it by a name, and I'm going to suppress the details, meaning inside of that computation, you don't need to know what it does. You just need to know, if I give it the right kind of input, it'll give me back an input that satisfies the contract that I set up.
比如计算平方根,我会用一段代码来说明,我将给它命名,并且忽略细节,意思就是在这一段计算过程中,你不用知道它做了什么,你只需知道,如果我进行了正确的输入,它将会给我符合条件的输出。
And in Python the expression is, operand, operator, operand, when we're doing simple expressions like this, and if I give it to the interpreter, it gives me back exactly what you'd expect, which is that value. OK?
在Python中表达式就是,运算对象,操作符,运算对象,当我们处理这样的简单表达式的时候,我把表达式传给处理器,处理器给我返回了我想要的结果,对不对?
应用推荐