From e730ec1a8c80fb00be04188660a37b1c9a907a29 Mon Sep 17 00:00:00 2001 From: Parvez Khan Date: Sat, 7 Oct 2023 11:16:24 +0530 Subject: [PATCH] Add Python function for checking if a number is even or odd --- is-even-function/is-even-function.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 is-even-function/is-even-function.py diff --git a/is-even-function/is-even-function.py b/is-even-function/is-even-function.py new file mode 100644 index 00000000..b3346566 --- /dev/null +++ b/is-even-function/is-even-function.py @@ -0,0 +1,8 @@ +def is_even(num): + return num % 2 == 0 + +result1 = is_even(6) +result2 = is_even(7) + +print(result1) # Should print True +print(result2) # Should print False