Skip to content

Commit 3924533

Browse files
authored
Merge pull request #264 from habibasorour/issue_250_listing
Issue 250 fixed: Added listing to 4.2
2 parents d70ea78 + fe0ef24 commit 3924533

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

source/ch4_conditionals.ptx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ if score >= 90: # Note the colon at the end of the line
5555
<section xml:id="use-the-if-else-statement">
5656
<title>Using the <c>if</c> - <c>else</c> Statement</title>
5757

58-
<p>The Java equivalent follows the same syntactical rules as before.</p>
59-
<program xml:id="python-if-else" interactive="activecode" language="python">
58+
<p><xref ref= "python-if-else" text="type-global"/> shows how the <c>if</c> - <c>else</c>statement is written in Python.</p>
59+
<listing xml:id="python-if-else">
60+
<program interactive="activecode" language="python">
6061
<code>
6162
age = 16
6263
if age &gt;= 18:
@@ -65,8 +66,11 @@ if score &gt;= 90: # Note the colon at the end of the line
6566
print("You are not yet eligible to vote.")
6667
</code>
6768
</program>
68-
69-
<program xml:id="java-if-else" language="java">
69+
</listing>
70+
71+
<p> <xref ref="java-if-else" text="type-global"/> is Java equivalent that follows the same syntactical rules as before.</p>
72+
<listing xml:id="java-if-else">
73+
<program interactive="activecode" language="java">
7074
<code>
7175
public class IfElseExample {
7276
public static void main(String[] args) {
@@ -80,6 +84,7 @@ if score &gt;= 90: # Note the colon at the end of the line
8084
}
8185
</code>
8286
</program>
87+
</listing>
8388
</section>
8489

8590
<section xml:id="elif">

0 commit comments

Comments
 (0)