There was an error while loading. Please reload this page.
1 parent 331d385 commit 40f1886Copy full SHA for 40f1886
1 file changed
source/ch4_conditionals.ptx
@@ -51,9 +51,9 @@ if score >= 90:
51
<program xml:id="python-if-else" interactive="activecode" language="python">
52
<code>
53
age = 16
54
- if age >= 18:
+ if age >= 18:
55
print("You can vote.")
56
- else:
+ else: # notice the semicolon
57
print("You are not yet eligible to vote.")
58
</code>
59
</program>
@@ -65,7 +65,7 @@ if score >= 90:
65
int age = 16;
66
if (age >= 18) {
67
System.out.println("You can vote.");
68
- } else {
+ } else { // else has its own block.
69
System.out.println("You are not yet eligible to vote.");
70
}
71
0 commit comments