So when you define a function, you have, as we've seen these curly braces, that define all ; of the code that's associated with that function; open curly brace code, close curly brace, that is the function.
当你定义一个函数,就像我们看到的这些花括号,定义了与,那个函数相关的所有代码;,左花括号,代码,右花括号,这就是一个函数。
So in return to, we have a slight variance here, -- where I'm defining apparently -- declaring a function called cube.
作为应答,这里我们有一点变化,这里我显然定义了-,声明了一个叫做cube的函数。
c point You can see inside of it, it's got a set of definitions for things like functions.
我会把它简短的命名为,你可以看到类的里面,有一个对于函数之类的东西的定义集。
So we do, in fact, have a dependence on what the angle is of the electron as we define it in the orbital.
实际上当我们定义电子在这个轨道,它的波函数的确是和角度有关的。
We'll then look at the quantity, internal energy, which we define through the first law, and we think of it as a function of two variables T and V.
接下来我们考虑内能,这是由热力学第一定律定义的物理量,我们把它看作T和V的函数。
But this choice of names, both for my functions and also for my parameters or my variables is completely up to me.
但是这个名字的选择,包括我的函数名,和我的参数名,或者变量名都是我定义的。
Absolutely, by functions, but you can also create local scope with curly braces.
绝对的,是由函数定义的,但是你也可以用花括号来创建局部范围。
> How can you name the function ?
>,你怎么样定义一个函数【听不见的】?
> Are scopes defined by curly braces or by functions?
>,范围是由花括号定义的还是函数定义的?
It's defined in CS50's library; its sole purpose in life is to ask the user for a floating point value and return it.
它被定义在CS50的函数库中,它的唯一目的是,向用户询问一个浮点数的值,然后返回它。
Are -- is scope defined by curly braces or by functions?
范围是由花括号定义的还是函数定义的?
It's defined later down which is fine.
等下再定义这个函数,那也是可以的。
应用推荐