I've written a little for loop, which is going to iterate over all of the elements in the list.
让我们先看看这儿的代码,我已经写了一个循环语句,用来迭代处理数组中所有的元素。
So notice the nesting, I can flow my way through how those tests are actually going to take place.
请注意嵌套,我可以跳过,其中不执行一些语句。
You can say if this is true, then go and do the following pieces of code or puzzle pieces that are inside this part of the block, else go ahead and do these that are down here.
你可以说如果条件成立,执行下面的代码段,或板块中的拼图,否则跳过去执行这下面的语句。
You've read the short article he has in the Jewish Study Bible, but he's also written about this at great length in other places.
你们已经读到过他在《犹太读经》里的短文,在其他的地方他也写过这些伟大的语句。
His language is a sort of mishmash of poorly used academic locutions: "worklife plans." It sounds almost like corporate speak, in a way.
他的语言是一种用得很不好的学术语句的混杂:,职业生涯计划,听起来就像是电脑在说话一样不自然。
So far, we have the following in our language. Right, we have assignment.
至今为止,我们已经学习了,该语言的以下内容,我们学习了赋值语句。
It didn't really crash, it found an assert statement. So if you look at the bottom of the function, you'll see that, in fact, I checked for that.
其实程序并没崩溃,它只是碰到一个断言语句然后停了下来,如果你看看函数的顶部,你会看到,实际上我断定计数器。
You've got a loop, you've got a condition and a boolean to check if he's touching the edge, and some statements to tell him to shout or to actually turn around.
我们有一个循环,通过一个条件和一个布尔值来判断,是否触到了边缘,还有一些语句,让它回头并咆哮。
Right. So similarly, if you've got one line of code with a semicolon at the end saying, this is the end of the statement, it doesn't really make sense to continue that conversation to try to continue conceptually that puzzle piece with curly braces.
对的,类似的,如果你得到了一行代码,后面有一个分号,标志语句的结尾,这就没有意义来继续,那个会话来尝试对那段代码,使用花括号。
When God began to create heaven and earth," And there's a parenthetical clause: "God said, 'Let there be light' and there was light."
起初,上帝创造天地“,这里有一个插入语句:,“上帝说,要有光,就有了光“
Well, the beauty is in this simple stupid little statement of the obvious.
关键的一点就是这个看似,有点愚蠢的语句。
So what we've seen is I've run it twice here.
我们现在看到的就是,我执行了这条打印语句两次。
First one, when I write a piece of code, especially code that has branches in it, when I design test cases for that piece of code, I should try and have a specific test case for each possible path through the code.
第一点,当我们写代码的时候,尤其是一些含有分支语句的代码的时候,当我为这些代码,设计测试用例的时候,我应该为每一个可能的程序路径,都设计一个特别的用例。
So you might have chosen a different sentence or whatnot, but that's fine.
所以你们可能选择了一个不同的语句,或其它的东西,但是那挺好的。
It's a capability that just tells the computer what to do.
语句能告诉计算机做什么。
But notice the previous line, where I am computing volatility.
但是请注意前面这个语句,我用这个语句计算了浮动值。
We decrement so to speak the variable and then where will we go next in terms of the flow control, the flow of this program.
可以这么说,我们递减这个变量,然后按照控制流,即程序流进入到下一语句。
But the string, the sentence or the words that we're displaying on the screen, previously you clicked on a little white text field and typed it in, well now you're gonna do the same thing at the keyboard but you're gonna have to sandwich it in between double quotation marks.
这些你想输出到屏幕上的字符串啊,语句啊,单词啊,或者你事先,在白色输入框中敲进去的内容,现在你们需要用键盘做同样的事情,但是你们要写在,双引号之间。
Step 5, now this is an example of what we'll henceforth call a condition or a branch because it's sort of a fork in the road.
步骤五,这是一个关于我们调用一个条件,或者分支语句的例子,因为这是一个岔路口。
Computers generally have things called--computer languages generally have things called "statements".
计算机语言,有一种叫做,“语句“的东西。
This is the first of the conditionals that we're going to see.
这是我们会学到的,第一个条件语句。
I'd last time talked about the two assert statements.
上节课我们已经探讨了,这两个断言语句。
Since I'm not sure I won't need to go back to it.
我注释掉了之前的调试语句。
The semicolon just separates this from the rest.
其中的分号只是用来间隔两条语句。
I get the int and store it in n. The switch statement takes inside its parenthesis an int or a char or some primitive type.
我得到一个整数并把它存储,到n中,switch语句的圆括号里可以是一个整数,或者一个字符或其他的基本类型。
This would be called a statement.
这就是一条语句。
But it's just a different statement.
但这是另外一条语句。
We have conditionals.
我们学习了条件语句。
A statement is an action.
一条语句是个动作。
应用推荐