Last active
February 22, 2024 18:17
-
-
Save karolosk/de5c6421ecad41d19e04e40f2541e7c4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = 3 | |
b = 4 | |
c = 5 | |
if a % 2 == 0: | |
print(f'{a} is even') | |
else: | |
print(f'{a} is odd') | |
if b % 2 == 0: | |
print(f'{b} is even') | |
else: | |
print(f'{b} is odd') | |
if c % 2 == 0: | |
print(f'{c} is even') | |
else: | |
print(f'{c} is odd') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Let's assume we have some variables (a, b, and c) and we need to check if those are even numbers.
This is an example on how we may do it without using functions.
Refactor the above by using functions.