Literally, return the control from this function, and take the value of the next expression, and return that as the value of the whole computation.
正如字面意义上说的,从这个函数返回,然后取得下一个表达式的值,并把这个值作为整个计算的结果返回。
What I have now is the following: I can write expressions, do combinations of things to get out values, I can store them away, I can print them up.
我已经讲过如下内容:,如何写表达式,如果把东西混合然后得到结果值,我可以将其保存,也可以将其显示。
So don't underestimate the value for the next week or two of just inserting printf statements into your code temporarily just to print out what the value of some variable is, or some expression is, so that you can just do a sanity check.
所以不要低估下一两周的重要性,虽然我们只将“printf“语句暂时地植入到,我们的代码中,只是用来打印一些,变量或表达式的值,所以你们提醒一下自己。
which I just did there, -mystring in fact, let me type it in-- mystring, with an equal sign, which is saying, assign or bind to that name the value of the following expression.
也就是这里我做的,实际上,让我输入,然后是个蹬好,意思就是说,把这个名字绑定到,后面表达式的值上去。
That code says the following: the IF says, I've got an expression, I'm going to evaluate it.
代码的含义是这样的:,我有一个表达式,我会去对这个表达式求值。
And so, in fact, if I wanted the other version of it, in fact, if I do this right, 23 it's going to give me 23 because it does the multiplication first, if I wanted the other version of it, Python I need to tell it that, by using, excuse me, parentheses.
因此,实际上,如果我想换种做法,实际上,如果我去执行这个表达式,返回值是3,因为乘法会被优先执行,如果我需要换种做法,我需要告诉,用括号来告诉它。
What do you think should happen if I evaluate that expression?
你认为我对表达式求值的话,会发生什么?
x It says, take the name x and create a binding for that name to the value of the sub-expression and in fact to do this, to stress a point, let's do that.
它的意思是,创建了一个名字,然后创建了对于这个名字,和子表达式的值的绑定,实际上这么做,我们是为了,要强调一个点,让我们来说说这个点。
In there, I want to make this distinction, this nuance: the evaluator is still going to be taking those expressions and using its rules to get a value, but it's not going to print them back out.
在这里,我想要做这么一个,细微差别:运算器依然会,对表达式,进行求值,但是不会,显示结果值。
All right? What's the value of that expression?
对不对?这个表达式的值是多少?
The interpreter is going to get a value for it.
处理器会对表达式运算得到一个结果值。
That's the Python saying, that is a command, that is a specific command to get the value of the expression and print it back out.
这代表着Python告诉我们这是一个命令,这是一个,得到表达式的值,并显示的特殊命令。
So if this is true do something else, true otherwise test and see if this is true, do something else, as many as I like followed by the end.
因此如果结果为true那么做一些操作,否则的话再看看这个表达式的值是不是,如果是的话做另外一些操作,我想要多少后面就可以跟多少。
So, operands. Let us take expressions, get values out, we can store them away in places, but ultimately we want to do something with them, so we need to now start talking about what are the things we can do inside of Python, or any programming language, to manipulate them.
也就是运算对象,让我们看看这些表达式,然后看看里面的这些值,我们可以把他们存在计算机的任何位置中,最终目的还是要对这些值做一些操作,因此我们现在需要开始讨论,在Python里面可以做什么,来操作它们了,或者在任何编程语言里。
应用推荐