There was an error while loading. Please reload this page.
2 parents 3924533 + 40f1886 commit 75ce01aCopy full SHA for 75ce01a
1 file changed
source/ch4_conditionals.ptx
@@ -60,9 +60,9 @@ if score >= 90: # Note the colon at the end of the line
60
<program interactive="activecode" language="python">
61
<code>
62
age = 16
63
- if age >= 18:
+ if age >= 18:
64
print("You can vote.")
65
- else:
+ else: # notice the semicolon
66
print("You are not yet eligible to vote.")
67
</code>
68
</program>
@@ -77,7 +77,7 @@ if score >= 90: # Note the colon at the end of the line
77
int age = 16;
78
if (age >= 18) {
79
System.out.println("You can vote.");
80
- } else {
+ } else { // else has its own block.
81
System.out.println("You are not yet eligible to vote.");
82
}
83
0 commit comments