Skip to content

Commit 49cdd3f

Browse files
committed
made pre tags to program and code for better readabiliy
1 parent 15a02a0 commit 49cdd3f

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

source/ch5_loopsanditeration.ptx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,24 +45,28 @@ public class DefiniteLoopExample {
4545
Recall that the <c>range</c> function provides you with a wide variety of options for controlling the value of the loop variable.
4646
</p>
4747

48-
<pre>
48+
<program xml:id="python-range-options">
49+
<code>
4950
range(stop)
5051
range(start,stop)
5152
range(start,stop,step)
52-
</pre>
53+
</code>
54+
</program>
5355

5456
<p>
5557
The Java <c>for</c> loop is really analogous to the last option giving you explicit control over the starting, stopping, and stepping in the three clauses inside the parenthesis.
5658
You can think of it this way:
5759
</p>
5860

59-
<pre>
61+
<program xml:id="java-for-loop-syntax">
62+
<code>
6063
for (start clause; stop clause; step clause) {
6164
statement1
6265
statement2
6366
...
6467
}
65-
</pre>
68+
</code>
69+
</program>
6670

6771
<p>
6872
If you want to start at 100, stop at 0 and count backward by 5, the Python loop would be written as:

0 commit comments

Comments
 (0)