You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b6432ff
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: source/ch_6_loopsanditeration.ptx
+11-11Lines changed: 11 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -10,8 +10,8 @@
10
10
So this section will just serve as a reference for the differences in syntax.
11
11
</p>
12
12
13
-
<p>
14
-
In Python the easiest way to write a definite loop is using the <c>for loop</c> in conjunction with the <c>range</c> function.
13
+
<p><idx><c>for</c> loop</idx>
14
+
A <term>definite loop</term> is a loop that is executed a specific or definite number of times. In Python, the easiest way to write a definite loop is using the <c>for</c> loop in conjunction with the <c>range</c> function.
15
15
For example:
16
16
</p>
17
17
@@ -47,7 +47,7 @@ range(start,stop)
47
47
range(start,stop,step)</pre>
48
48
49
49
<p>
50
-
The Java <c>for loop</c> is really analogous to the last option giving you explicit control over the starting, stopping, and stepping in the three clauses inside the parenthesis.
50
+
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.
51
51
You can think of it this way:
52
52
</p>
53
53
@@ -69,7 +69,7 @@ for i in range(100, -1, -5):
69
69
</program>
70
70
71
71
<p>
72
-
In Java we would write this as:
72
+
In Java, we would write this as:
73
73
</p>
74
74
75
75
<programinteractive="activecode"language="java">
@@ -85,12 +85,12 @@ public class DefiniteLoopBackward {
85
85
</program>
86
86
87
87
<p>
88
-
In Python the for loop can also iterate over any sequence such as a list, a string, or a tuple.
89
-
Java also provides a variation of its <c>for loop</c> that provides the same functionality in its so-called for each loop.
88
+
In Python, the <c>for</c> loop can also iterate over any sequence such as a list, a string, or a tuple.
89
+
Java also provides a variation of its <c>for</c> loop that provides the same functionality in its so-called for each loop.
0 commit comments