From 5a1eb52a134842c7760c32af0bdcf433a3a636b8 Mon Sep 17 00:00:00 2001 From: rachealben <133984839+rachealben@users.noreply.github.com> Date: Tue, 9 Apr 2024 17:56:36 +0100 Subject: [PATCH] Update 026_ifs.py --- 026_ifs.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/026_ifs.py b/026_ifs.py index c391e53f..e771cd94 100644 --- a/026_ifs.py +++ b/026_ifs.py @@ -54,7 +54,10 @@ def is_first_of_the_month(day_number): # Return "First of the month!" if the day number is 1. # Return "Not first of the month" otherwise. - pass + if day_number == 1: + print("First of the month!") + else: + print("Not first of the month") check_that_these_are_equal( is_first_of_the_month(1), @@ -75,7 +78,19 @@ def has_five_chars(the_str): # Return "STRING is five characters long" if the string # is five characters long. # Otherwise, return "Not five characters". - pass + if len(the_str) == 5: + return the_str + " is five characters long" + else: + return "Not five characters" + + +# Function to check if two values are equal +def check_that_these_are_equal(value1, value2): + if value1 == value2: + print("Test Passed!") + else: + print("Test Failed!") + check_that_these_are_equal( has_five_chars("ABCDE"),