From c424ff24fb9034ae1b9500103bf3aaeeb0777554 Mon Sep 17 00:00:00 2001 From: mercael91 Date: Wed, 19 Aug 2026 18:41:39 +0000 Subject: [PATCH 1/2] checks: add beginner-facing messages to bare assertions in variables1/variables2 (#80) --- checks/variables/variables1.py | 7 ++++--- checks/variables/variables2.py | 9 +++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/checks/variables/variables1.py b/checks/variables/variables1.py index edaed3f..2852795 100644 --- a/checks/variables/variables1.py +++ b/checks/variables/variables1.py @@ -1,7 +1,8 @@ +# checks/variables/variables1.py assert isinstance(a, int), "a should be an integer" assert isinstance(b, float), "b should be a float" assert isinstance(c, str), "c should be a string" -assert a == 0 -assert b == 0.0 -assert c == "" +assert a == 0, "a should be 0 — the default value from the exercise" +assert b == 0.0, "b should be 0.0 — a float, not an int" +assert c == "", "c should be an empty string" print("variables1 ✓") diff --git a/checks/variables/variables2.py b/checks/variables/variables2.py index 2c66357..4b27f64 100644 --- a/checks/variables/variables2.py +++ b/checks/variables/variables2.py @@ -1,3 +1,4 @@ +# checks/variables/variables2.py sum_ab = a + b diff_ab = a - b product_ab = a * b @@ -12,8 +13,8 @@ assert sum_ab == 13, "sum_ab should be 13" assert diff_ab == 7, "diff_ab should be 7" assert product_ab == 30, "product_ab should be 30" -assert quotient_ab == 3.3333333333333335 -assert remainder_ab == 1 -assert sum_ac == "10hello" -assert product_ac == "hellohellohello" +assert quotient_ab == 3.3333333333333335, "quotient_ab should be 10 / 3" +assert remainder_ab == 1, "remainder_ab should be 10 % 3" +assert sum_ac == "10hello", "sum_ac should be str(a) + c" +assert product_ac == "hellohellohello", "product_ac should be c * b" print("variables2 ✓") From a0143b43e5c79da4539d49bb5ff8d5ba65804d2f Mon Sep 17 00:00:00 2001 From: Abhik Sarkar Date: Fri, 21 Aug 2026 08:46:22 +0530 Subject: [PATCH 2/2] checks: state expected values in the variables2 messages Four messages restated the check's own computation, which the learner never sees: "sum_ac should be str(a) + c" is the line above it. State the expected value instead, matching "sum_ab should be 13" already in the file. --- checks/variables/variables2.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/checks/variables/variables2.py b/checks/variables/variables2.py index 4b27f64..737b805 100644 --- a/checks/variables/variables2.py +++ b/checks/variables/variables2.py @@ -13,8 +13,8 @@ assert sum_ab == 13, "sum_ab should be 13" assert diff_ab == 7, "diff_ab should be 7" assert product_ab == 30, "product_ab should be 30" -assert quotient_ab == 3.3333333333333335, "quotient_ab should be 10 / 3" -assert remainder_ab == 1, "remainder_ab should be 10 % 3" -assert sum_ac == "10hello", "sum_ac should be str(a) + c" -assert product_ac == "hellohellohello", "product_ac should be c * b" +assert quotient_ab == 3.3333333333333335, "quotient_ab should be about 3.3333" +assert remainder_ab == 1, "remainder_ab should be 1" +assert sum_ac == "10hello", "sum_ac should be '10hello'" +assert product_ac == "hellohellohello", "product_ac should be 'hellohellohello'" print("variables2 ✓")