Skip to content

Commit 46ea47f

Browse files
committed
if statements exercise completed
1 parent 2db5ac0 commit 46ea47f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

026_ifs.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@
5454
def is_first_of_the_month(day_number):
5555
# Return "First of the month!" if the day number is 1.
5656
# Return "Not first of the month" otherwise.
57-
pass
57+
if day_number == 1:
58+
return "First of the month!"
59+
else:
60+
return "Not first of the month"
5861

5962
check_that_these_are_equal(
6063
is_first_of_the_month(1),
@@ -75,7 +78,11 @@ def has_five_chars(the_str):
7578
# Return "STRING is five characters long" if the string
7679
# is five characters long.
7780
# Otherwise, return "Not five characters".
78-
pass
81+
if len(the_str) == 5:
82+
return f"{the_str} is five characters long"
83+
else:
84+
return "Not five characters"
85+
7986

8087
check_that_these_are_equal(
8188
has_five_chars("ABCDE"),

0 commit comments

Comments
 (0)