Skip to content

Commit 40f1886

Browse files
committed
added comments to 4.2 blocks
1 parent 331d385 commit 40f1886

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

source/ch4_conditionals.ptx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ if score >= 90:
5151
<program xml:id="python-if-else" interactive="activecode" language="python">
5252
<code>
5353
age = 16
54-
if age &gt;= 18:
54+
if age &gt;= 18:
5555
print("You can vote.")
56-
else:
56+
else: # notice the semicolon
5757
print("You are not yet eligible to vote.")
5858
</code>
5959
</program>
@@ -65,7 +65,7 @@ if score &gt;= 90:
6565
int age = 16;
6666
if (age &gt;= 18) {
6767
System.out.println("You can vote.");
68-
} else {
68+
} else { // else has its own block.
6969
System.out.println("You are not yet eligible to vote.");
7070
}
7171
}

0 commit comments

Comments
 (0)