Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# Function to determine if number is odd or even
# A Codecademy Python (Function and Control) assignment
# Dr. Steven B. Combs, coding novice
def is_even(x):
if x % 2 == 0: # If varialble is divisible by 2 without remainder
return "yep" # The variable is even
return "nope"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.