"whileループ"の翻訳 英語に:


  例 (レビューされていない外部ソース)

whileループがあります
You've never seen this before, but the general structure should be familiar.
whileループの構文はこうです
The kind of loop that we are gonna introduce first is called the while loop
ここでwhileループの代わりにforループを置きます
We'll use i as that variable just like we did in the while loop version.
ループのためにwhileが必要です
We'll use i for that, and we start with 1 that's the first number to print out.
ではwhileループの例を挙げます
There's no requirement that guarantees the test expression eventually becomes False
2つ目は文とbreakのあるwhileループ
The first one is a while loop with a nested if.
whileループではそれが明白でした
The result we want to return is the index where we found the match.
while trueのループの中にあるものは
Then we're just going to keep repeating this until nothing changes.
while n 1である限り続くという whileループにしましょう
We're going to keep multiplying by n until we get to the end.
まずwhileループを通る前の段階では
How are we going to show that this is the case?
whileテストでループを停止するのではなく whileテストをTrueにします
We could rewrite that using break.
1つ目はネスト化されたifのあるwhileループ
Here are the four choices.
3つ目はネスト化されたifのあるwhileループ
The second one is a while loop with the statement and a break.
whileループを使う必要がありそうですね
The goal here is to countdown from n all the way down to blastoff.
forループよりwhileループで find elementを定義することから考え始めるのが
I'll also show you a way to define it using a for loop.
条件がtrueの時 whileループが終わらないことがあります このwhileループが絶対に終わらないと検知して
The way we interpret JavaScript is by running it, and in the process of running it, we're never going to exit this Y loop because the condition is true.
breakが意味するのはwhileループの実行を止め
When the break test is true, what we have is break whichà   by itselfà   is all we need.
これでwhileループと同じ機能が作れました
When it is false or if it ever is false, we simply don't do anything which is exactly the same functionality we had with the while loop implementation.
次の文が実行されwhileループが始まります
A subroutine called countdown takes an input x.
V があります では while ループ を書きましょう
So, here's my vector
ちなみにこれはwhileループが機能する方法です
You should remember the while loop from the previous unit.
通常はwhileループで問題を解く方が効率的です
So any problem you can solve either way.
関数を定義しwhileループを使ってみてください
So this one's going to require some thought, but you know enough to be able to do it.
そのためwhileループのテストを i len p にする必要があります whileループのブロックで現在の要素が tと一致するかどうか調べ
The stopping condition for the while loop is when i reaches the len(p), so we want our test for the while loop to be i lt len(p).
1つ目はPythonのwhileを使う方法で もう1つはループを再帰的に実装することです プログラミングではwhileループも再帰呼び出しも
So while tell you two ways to solve this the first is going to re use the Python while, and the second is going to implement the while loop recursively.
whileループの停止条件はiがlen p に達した時です
We'll use that as the index to go through the loop.
次に確かめたいのはwhileループの最初の段階でも
We're saying that's ab equals ab 0. Well, that's kind of obvious.
つまりコードを実行し whileループを繰り返している間中
It starts out true but it remains true each time it goes through the while loop.
すべて同じ作用があります whileループで定義したり
So we've seen 4 different ways to define the find_element method.
終了だと分かります 継続する方法はwhileループです
And when the call to get_next_target returns None for the URL, we know we're done.
tocrawlに残っているものがある間 whileループを続けます
When we start we have a depth of 0.
入力に少なくとも2文字残っている間はループを続ける whileループを設定します
As described before, this is initially 2.
4つ目はネスト化されたif とelse そしてbreakのあるwhileループ
The third choice is a while loop with a nested if.
whileループ内で数値を表示して 最後にBlastoff を表示します
Let's leave the condition blank for now because we already know what we need to do inside the while loop, and that is, print the number.
whileループで行ったように一致すれば結果を返します
So our test is using to compare e and t.
条件式がFalseになるまでこの手順を繰り返し その後はwhile文の後ろの処理を続けていきます whileループはwhileキーワードと式と
Again, if it's still true, then we evaluate the loop body, and we continue this process until the conditional expression is false, at which point we continue on after the while loop.
pの要素を処理するループを定義します whileループがあります 変数iを挿入しました
We'll define the loop to go through the elements of p, similarly to the previous while loops we've seen that go through lists.
whileループがあります テスト条件は10と等しくないことです
We start by assigning zero to i
入力としてpageを受け取りwhileループを使用します whileループのテスト条件を空白にしておきます それが何か自分で見つけてみてください
What we're going to do is define a procedure that will print all the links on the page, and it takes the page as input, and so we want to use a while loop to keep going, and I am going to leave blank the test condition for the while loop.
別の開始タグが見つからない場合は whileループが終了します
If I find an opening tag when it comes to the top of the while loop, it'll go through again.
whileループで行ったように その変数としてiを使用します
So we still need to use a variable to keep track of the index.
もう一度returnを入力すると このwhileループが実行を始めます
We're going to increase i by 2, and then we're going to print i .
nが全体数の時whileループを抜けるごとに 1ステップ分ステップダウンします
Here we have n n 1.
まずwhileループを使用して これを解く方法を見てみましょう
Evans There are many different ways we could solve this problem.
問題を解くことができるという点では 再帰でできることは 何でもwhileループでもできますし whileループでできることは何でも再帰でもできます
So this is a good question and in terms of being able to solve a problem, anything you can do with recursion you can also do with a 'while' loop.