From 40f1886393ca0ea2cb4a8db452a15b589e633fb0 Mon Sep 17 00:00:00 2001 From: Habiba Sorour Date: Tue, 28 Jul 2026 22:52:25 +0300 Subject: [PATCH] added comments to 4.2 blocks --- source/ch4_conditionals.ptx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/ch4_conditionals.ptx b/source/ch4_conditionals.ptx index 0b32d00..9ff1edc 100644 --- a/source/ch4_conditionals.ptx +++ b/source/ch4_conditionals.ptx @@ -51,9 +51,9 @@ if score >= 90: age = 16 - if age >= 18: + if age >= 18: print("You can vote.") - else: + else: # notice the semicolon print("You are not yet eligible to vote.") @@ -65,7 +65,7 @@ if score >= 90: int age = 16; if (age >= 18) { System.out.println("You can vote."); - } else { + } else { // else has its own block. System.out.println("You are not yet eligible to vote."); } }