Continue must be in a loop (e.g., for, do, while). It cannot appear in case constructs.
continue一定是在for,do,while这些循环中,而不能在实例构建中出现。
For a while loop, however, this means the code in the else clause is executed once, after the loop is terminated (see the pseudocode shown in Listing 7).
但是对于while循环,这意味着在循环终止后,else子句中的代码被执行一次(参见清单7中的伪代码)。
The for loop now iterates through the copy, while you're modifying the original list.
现在for 循环将迭代该副本,而对原始 list进行修改。
The while loop (like the for loop introduced later in this article) supports three additional statements
while循环(与本文后面介绍的for 循环一样)支持三种附加语句
Seeking needs to be turned off, if even for a little while, so that the system does not run in an endless loop.
搜寻需要被关掉,即使是一小会,从而使我们的系统不会无休止的循环下去。
That's why the main test method in Listing 1 USES a while loop instead of a new for loop.
这就是为什么清单1中的main测试方法使用while循环而不是一个新的for循环。
Now instinctively, prefer the for loop or the while loop?
现在凭感觉,你们喜欢for循环还是while循环?
A while loop will rarely include the number of iterations — unless it is a for loop in disguise.
while循环很少包含迭代次数——除非它是一个伪装的for循环。
For instance, you can see that any time the if condition is true, the nested while loop will execute at least one time (because the list length will be greater than zero).
例如,您可以看到,每当if条件为真的时候,嵌入其中的while循环至少会执行一次(因为list的长度肯定大于0)。
At the end of the day, you can implement the exact same program using a while loop that you can using a for loop, it's just your code is going to look slightly different.
最终,你可以执行这个程序,再使用for循环的地方使用while循环,这只是使你的代码看起来稍微有点不同。
Because the for loop hands me placeholders in between those semicolons for variables and such, now I don't have those with while loops.
因为for循环给我提供了为变量准备的占位符,它们在分号之间,现在在while循环中,我没有这些。
For each line of data returned by the data source, the while loop will take in the line as an object, and spit out a Zip tag with all the data in the database (see Listing 1).
对于由该数据源返回的每行数据,while循环将会在该行做为一个对象被调用,并且输出一个所有数据都在数据库中的Zip标记(请参阅清单1)。
Notice how this method accounts for possible weak references in the queue with the do-while loop.
请注意该方法如何用do -while循环来处理队列中可能存在的弱引用。
Instead, the program enters a while loop waiting for new connections.
相反,程序进入一个while循环,等待新的连接。
A while loop then iterates through the dataset, storing the information in a convenient array for later display.
然后,一个while循环迭代数据集,在一个方便的数组中存储信息以便将来进行显示。
Substep 3-2 is to run a while loop for each item in the list.
子步骤3 - 2是为清单中的每一产品运行while循环。
The contents of the new while loop are expanded for view.
新while循环的内容将展开以供查看。
V6.2 offers a new feature to automatically perform these steps for you. To move a set of tasks into a while loop, do the following.
提供了一个新功能,可以自动为您执行这些步骤。
Our diagram for the while loop contains both a condition and an asterisk, signaling iteration, but as you can see the number of iterations is unavailable.
我们的while循环图既包含条件,又包含表明迭代的星号,但您会发现,没有迭代的次数。
For this purpose, I have used a do-while loop that continues dividing the value integer by 256 until the value drops below 1.
为此,我使用了一个do -while循环,它不断地将value整数除以256,直到得到的值小于1。
Listing 7. Pseudocode for the while loop.
清单7. while循环的伪代码。
This article has introduced three Python program statements: the if statement, the while loop, and the for loop.
本文介绍了三种Python程序语句:if语句、while循环和for循环。
The upper half of this figure shows the three modeling elements to represent a while loop, a do-while loop, and a for loop.
此图的上半部分显示了三种建模元素,分别表示while loop、do-while loop和 for loop。
Looping statements (WHILE, LOOP, for example) must not that contain FETCH statements.
循环语句(例如WHILE、LOOP)不能包含fetch语句。
BuildCanary then goes back to the top of its while loop and waits for the next message.
然后,BuildCanary回到while循环的顶端,等待下一条消息。
The diagram for the while loop is shown in Figure 6.
图6显示了while循环图。
When things go wrong the pessimist tends to blame himself, while the optimist looks for loop holes.
当犯错误时悲观主义者倾向于责备他自己,而乐观主义者寻找漏洞。
When things go wrong the pessimist tends to blame himself, while the optimist looks for loop holes.
当犯错误时悲观主义者倾向于责备他自己,而乐观主义者寻找漏洞。
应用推荐