Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 026_ifs.py #12

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions 026_ifs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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"),
Expand Down