Skip to content

Commit

Permalink
please review this one (#55)
Browse files Browse the repository at this point in the history
This merges @Godsway80's pull request with a simple solution which returns if a number is even.
  • Loading branch information
Overlrd authored Jan 12, 2025
2 parents 49836da + 96f8369 commit bb57e15
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions solutions/check_if_a_number_is_even_or_odd
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
def is_even(number):
"""
Returns True if the number is even, False otherwise.
:param number: The number to check
:return: True if number is even, False if odd
"""
return number % 2 == 0

if __name__ == "__main__":
# Example test to demonstrate functionality
num = 4
if is_even(num):
print(f"{num} is even.")
else:
print(f"{num} is odd.")

0 comments on commit bb57e15

Please sign in to comment.