Skip to content

未和訳部分の翻訳の提案 該当箇所 4.5. ループの else 節 #1021

Description

@r-arimura7

概要

4.5. ループのelse節の前8パラグラフのうち、1パラグラフのみ未和訳になっている

問題のある箇所 (URLで指定すること)

https://docs.python.org/ja/3/tutorial/controlflow.html#else-clauses-on-loops
One way to think of the else clause is to imagine it paired with the if inside the loop. As the loop executes, it will run a sequence like if/if/if/else. The if is inside the loop, encountered a number of times. If the condition is ever true, a break will happen. If the condition is never true, the else clause outside the loop will execute.

問題の詳細

当該セクション4.5の他の部分は和訳されているものの、中途のパラグラフだけ英文のままのため、読者側にコンテクストスイッチが生じている可能性がある。

修正案

このelse句は、ループの中のifと対となっている、と考えることができます。ループが実行されるに従って,ループはif/if/if/elseといったシークエンスを走らせます。ループの中にあるifは複数回処理されることになります。そして、条件式が真の場合のみ、breakが実行されます。条件式が真でなければ、ループの外にあるelse句が実行されるわけです.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions